Skip to content

Commit

Permalink
Merge pull request #827 from basedosdados/fix_br_me_cnpj
Browse files Browse the repository at this point in the history
[Refactor] br_me_cnpj
  • Loading branch information
folhesgabriel authored Nov 14, 2024
2 parents 55a70ec + a967b54 commit ac5afc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions models/br_me_cnpj/br_me_cnpj__empresas.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"data_type": "date",
},
pre_hook="DROP ALL ROW ACCESS POLICIES ON {{ this }}",
incremental_strategy="insert_overwrite",
)
}}
with
Expand All @@ -28,4 +27,4 @@ with
)
select *
from cnpj_empresas
{% if is_incremental() %} where data in ('2024-09-18', '2024-10-16') {% endif %}
{% if is_incremental() %} where data > (select max(data) from {{ this }}) {% endif %}
3 changes: 1 addition & 2 deletions models/br_me_cnpj/br_me_cnpj__estabelecimentos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"data_type": "date",
},
cluster_by="sigla_uf",
incremental_strategy="insert_overwrite",
pre_hook="DROP ALL ROW ACCESS POLICIES ON {{ this }}",
)
}}
Expand Down Expand Up @@ -60,4 +59,4 @@ with
)
select *
from cnpj_estabelecimentos
{% if is_incremental() %} where data in ('2024-09-18', '2024-10-16') {% endif %}
{% if is_incremental() %} where data > (select max(data) from {{ this }}) {% endif %}
3 changes: 1 addition & 2 deletions models/br_me_cnpj/br_me_cnpj__socios.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"data_type": "date",
},
pre_hook="DROP ALL ROW ACCESS POLICIES ON {{ this }}",
incremental_strategy="insert_overwrite",
)
}}
with
Expand All @@ -33,4 +32,4 @@ with
)
select *
from cnpj_socios
{% if is_incremental() %} where data in ('2024-09-18', '2024-10-16') {% endif %}
{% if is_incremental() %} where data > (select max(data) from {{ this }}) {% endif %}

0 comments on commit ac5afc7

Please sign in to comment.