-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #566 from basedosdados/add-test-in-diretorios
[tests] br_bd_diretorios
- Loading branch information
Showing
22 changed files
with
631 additions
and
739 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__area_conhecimento.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,18 @@ | ||
{{ | ||
config( | ||
alias="area_conhecimento", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select distinct | ||
safe_cast(especialidade as string) especialidade, | ||
safe_cast(descricao_especialidade as string) descricao_especialidade, | ||
safe_cast(subarea as string) subarea, | ||
safe_cast(descricao_subarea as string) descricao_subarea, | ||
safe_cast(area as string) area, | ||
safe_cast(descricao_area as string) descricao_area, | ||
safe_cast(grande_area as string) grande_area, | ||
safe_cast(descricao_grande_area as string) descricao_grande_area | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.area_conhecimento` as t |
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
11 changes: 11 additions & 0 deletions
11
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__cid_9.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,11 @@ | ||
{{ | ||
config( | ||
alias="cid_9", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(categoria as string) categoria, safe_cast(descricao as string) descricao | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.cid_9` as t |
15 changes: 15 additions & 0 deletions
15
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__curso_superior.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,15 @@ | ||
{{ | ||
config( | ||
alias="curso_superior", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(id_curso as string) id_curso, | ||
safe_cast(nome_curso as string) nome_curso, | ||
safe_cast(id_area as string) id_area, | ||
safe_cast(nome_area as string) nome_area, | ||
safe_cast(grau_academico as string) grau_academico | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.curso_superior` as t |
16 changes: 16 additions & 0 deletions
16
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__distrito_1991.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,16 @@ | ||
{{ | ||
config( | ||
alias="distrito_1991", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(ano as int64) ano, | ||
safe_cast(id_distrito as string) id_distrito, | ||
safe_cast(nome as string) nome, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(sigla_uf as string) sigla_uf | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.distrito` | ||
where ano = '1991' |
16 changes: 16 additions & 0 deletions
16
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__distrito_2000.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,16 @@ | ||
{{ | ||
config( | ||
alias="distrito_2000", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(ano as int64) ano, | ||
safe_cast(id_distrito as string) id_distrito, | ||
safe_cast(nome as string) nome, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(sigla_uf as string) sigla_uf | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.distrito` | ||
where ano = '2000' |
16 changes: 16 additions & 0 deletions
16
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__distrito_2010.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,16 @@ | ||
{{ | ||
config( | ||
alias="distrito_2010", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(ano as int64) ano, | ||
safe_cast(id_distrito as string) id_distrito, | ||
safe_cast(nome as string) nome, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(sigla_uf as string) sigla_uf | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.distrito` | ||
where ano = '2010' |
29 changes: 29 additions & 0 deletions
29
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__escola.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,29 @@ | ||
{{ | ||
config( | ||
alias="escola", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(id_escola as string) id_escola, | ||
safe_cast(nome as string) nome, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(sigla_uf as string) sigla_uf, | ||
safe_cast(restricao_atendimento as string) restricao_atendimento, | ||
safe_cast(localizacao as string) localizacao, | ||
safe_cast(localidade_diferenciada as string) localidade_diferenciada, | ||
safe_cast(categoria_administrativa as string) categoria_administrativa, | ||
safe_cast(endereco as string) endereco, | ||
safe_cast(telefone as string) telefone, | ||
safe_cast(dependencia_administrativa as string) dependencia_administrativa, | ||
safe_cast(categoria_privada as string) categoria_privada, | ||
safe_cast(conveniada_poder_publico as string) conveniada_poder_publico, | ||
safe_cast(regulacao_conselho_educacao as string) regulacao_conselho_educacao, | ||
safe_cast(porte as string) porte, | ||
safe_cast(etapas_modalidades_oferecidas as string) etapas_modalidades_oferecidas, | ||
safe_cast(outras_ofertas_educacionais as string) outras_ofertas_educacionais, | ||
safe_cast(latitude as string) latitude, | ||
safe_cast(longitude as string) longitude | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.escola` as t |
12 changes: 12 additions & 0 deletions
12
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__etnia_indigena.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,12 @@ | ||
{{ | ||
config( | ||
alias="etnia_indigena", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(id_etnia_indigena as string) id_etnia_indigena, | ||
safe_cast(nome as string) nome | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.etnia_indigena` as t |
17 changes: 17 additions & 0 deletions
17
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__instituicao_ensino_superior.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,17 @@ | ||
{{ | ||
config( | ||
alias="instituicao_ensino_superior", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(id_ies as string) id_ies, | ||
safe_cast(nome as string) nome, | ||
safe_cast(tipo_instituicao as string) tipo_instituicao, | ||
safe_cast(rede as string) rede, | ||
safe_cast(situacao_funcionamento as string) situacao_funcionamento, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(sigla_uf as string) sigla_uf | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.instituicao_ensino_superior` as t |
13 changes: 13 additions & 0 deletions
13
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__pais.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,13 @@ | ||
{{ | ||
config( | ||
schema="br_bd_diretorios_brasil", | ||
alias="pais", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(id_pais as string) id_pais, | ||
safe_cast(nome as string) nome, | ||
safe_cast(nacionalidade as string) nacionalidade | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.pais` as t |
10 changes: 10 additions & 0 deletions
10
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__regiao.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,10 @@ | ||
{{ | ||
config( | ||
alias="regiao", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select safe_cast(sigla as string) sigla, safe_cast(nome as string) nome | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.regiao` as t |
24 changes: 24 additions & 0 deletions
24
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__setor_censitario.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,24 @@ | ||
{{ | ||
config( | ||
alias="setor_censitario", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(ano as int64) ano, | ||
safe_cast(id_setor_censitario as string) id_setor_censitario, | ||
safe_cast(id_municipio as string) id_municipio, | ||
safe_cast(id_rm as string) id_rm, | ||
safe_cast(nome_rm as string) nome_rm, | ||
safe_cast(id_distrito as string) id_distrito, | ||
safe_cast(nome_distrito as string) nome_distrito, | ||
safe_cast(id_subdistrito as string) id_subdistrito, | ||
safe_cast(nome_subdistrito as string) nome_subdistrito, | ||
safe_cast(id_bairro as string) id_bairro, | ||
safe_cast(nome_bairro as string) nome_bairro, | ||
safe_cast(sigla_uf as string) sigla_uf, | ||
safe_cast(situacao_setor as string) situacao_setor, | ||
safe_cast(tipo_setor as string) tipo_setor | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.setor_censitario` as t |
12 changes: 12 additions & 0 deletions
12
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__subatividade_ibge.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,12 @@ | ||
{{ | ||
config( | ||
alias="subatividade_ibge", | ||
schema="br_bd_diretorios_brasil", | ||
materialized="table", | ||
) | ||
}} | ||
|
||
select | ||
safe_cast(id_subatividade as string) id_subatividade, | ||
safe_cast(descricao as string) descricao | ||
from `basedosdados-dev.br_bd_diretorios_brasil_staging.subatividade_ibge` as t |
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
Oops, something went wrong.