-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into create_dict
- Loading branch information
Showing
24 changed files
with
1,422 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,9 +60,6 @@ models: | |
br_b3_cotacoes: | ||
+materialized: table | ||
+schema: br_b3_cotacoes | ||
+post-hook: | ||
- REVOKE `roles/bigquery.dataViewer` ON TABLE {{ this }} FROM "specialGroup:allUsers" | ||
- GRANT `roles/bigquery.dataViewer` ON TABLE {{ this }} TO "group:[email protected]" | ||
br_bcb_agencia: | ||
+materialized: table | ||
+schema: br_bcb_agencia | ||
|
@@ -189,6 +186,9 @@ models: | |
br_ibge_pof: | ||
+materialized: table | ||
+schema: br_ibge_pof | ||
br_ibge_ppm: | ||
+materialized: table | ||
+schema: br_ibge_ppm | ||
br_inep_ana: | ||
+materialized: table | ||
+schema: br_inep_ana | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{ | ||
config( | ||
alias="efetivo_rebanhos", | ||
schema="br_ibge_ppm", | ||
partition_by={ | ||
"field": "ano", | ||
"data_type": "int64", | ||
"range": {"start": 1974, "end": 2022, "interval": 1}, | ||
}, | ||
cluster_by=["sigla_uf"], | ||
) | ||
}} | ||
select | ||
safe_cast(ano as int64) ano, | ||
safe_cast(sigla_uf as string) sigla_uf, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(tipo_rebanho as string) tipo_rebanho, | ||
safe_cast(quantidade as int64) quantidade | ||
from `basedosdados-staging.br_ibge_ppm_staging.efetivo_rebanhos` as t | ||
where quantidade is not null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{{ | ||
config( | ||
alias="producao_aquicultura", | ||
schema="br_ibge_ppm", | ||
partition_by={ | ||
"field": "ano", | ||
"data_type": "int64", | ||
"range": {"start": 2013, "end": 2022, "interval": 1}, | ||
}, | ||
cluster_by=["sigla_uf"], | ||
) | ||
}} | ||
select | ||
safe_cast(ano as int64) ano, | ||
safe_cast(sigla_uf as string) sigla_uf, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(produto as string) produto, | ||
safe_cast(quantidade as int64) quantidade, | ||
safe_cast(valor as int64) valor, | ||
from `basedosdados-staging.br_ibge_ppm_staging.producao_aquicultura` as t | ||
where quantidade is not null |
22 changes: 22 additions & 0 deletions
22
models/br_ibge_ppm/br_ibge_ppm__producao_origem_animal.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{{ | ||
config( | ||
alias="producao_origem_animal", | ||
schema="br_ibge_ppm", | ||
partition_by={ | ||
"field": "ano", | ||
"data_type": "int64", | ||
"range": {"start": 1974, "end": 2022, "interval": 1}, | ||
}, | ||
cluster_by=["sigla_uf"], | ||
) | ||
}} | ||
select | ||
safe_cast(ano as int64) ano, | ||
safe_cast(sigla_uf as string) sigla_uf, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(produto as string) produto, | ||
safe_cast(unidade as string) unidade, | ||
safe_cast(quantidade as int64) quantidade, | ||
safe_cast(valor as int64) valor, | ||
from `basedosdados-staging.br_ibge_ppm_staging.producao_origem_animal` as t | ||
where quantidade is not null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{ | ||
config( | ||
alias="producao_pecuaria", | ||
schema="br_ibge_ppm", | ||
partition_by={ | ||
"field": "ano", | ||
"data_type": "int64", | ||
"range": {"start": 1974, "end": 2022, "interval": 1}, | ||
}, | ||
cluster_by=["sigla_uf"], | ||
) | ||
}} | ||
select | ||
safe_cast(ano as int64) ano, | ||
safe_cast(sigla_uf as string) sigla_uf, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(ovinos_tosquiados as int64) ovinos_tosquiados, | ||
safe_cast(vacas_ordenhadas as int64) vacas_ordenhadas, | ||
from `basedosdados-staging.br_ibge_ppm_staging.producao_pecuaria` as t | ||
where ovinos_tosquiados is not null or vacas_ordenhadas is not null |
Oops, something went wrong.