-
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 pull request #316 from basedosdados/staging/br_bd_diretorios.cnae
[dbt] br_bd_diretorios_brasil.cnae
- Loading branch information
Showing
3 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__cnae_1.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='cnae_1', | ||
schema='br_bd_diretorios_brasil', | ||
materialized='table',) | ||
}} | ||
SELECT | ||
SAFE_CAST(REPLACE(REPLACE(t.cnae_1, '.', ''), '-', '') AS STRING) AS cnae_1, | ||
SAFE_CAST(t.descricao AS STRING) AS descricao, | ||
SAFE_CAST(t.grupo AS STRING) AS grupo, | ||
SAFE_CAST(t.descricao_grupo AS STRING) AS descricao_grupo, | ||
SAFE_CAST(t.divisao AS STRING) AS divisao, | ||
SAFE_CAST(t.descricao_divisao AS STRING) AS descricao_divisao, | ||
SAFE_CAST(t.secao AS STRING) AS secao, | ||
SAFE_CAST(t.descricao_secao AS STRING) AS descricao_secao | ||
FROM basedosdados-staging.br_bd_diretorios_brasil_staging.cnae_1 AS t |
16 changes: 16 additions & 0 deletions
16
models/br_bd_diretorios_brasil/br_bd_diretorios_brasil__cnae_2.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='cnae_2', | ||
schema='br_bd_diretorios_brasil', | ||
materialized='table',) | ||
}} | ||
SELECT | ||
SAFE_CAST(REPLACE(REPLACE(cnae_2, '.', ''), '-', '') AS STRING) AS cnae_2, | ||
SAFE_CAST(descricao AS STRING) AS descricao, | ||
SAFE_CAST(grupo AS STRING) AS grupo, | ||
SAFE_CAST(descricao_grupo AS STRING) AS descricao_grupo, | ||
SAFE_CAST(divisao AS STRING) AS divisao, | ||
SAFE_CAST(descricao_divisao AS STRING) AS descricao_divisao, | ||
SAFE_CAST(secao AS STRING) AS secao, | ||
SAFE_CAST(descricao_secao AS STRING) AS descricao_secao | ||
FROM basedosdados-staging.br_bd_diretorios_brasil_staging.cnae_2 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