diff --git a/models/br_me_comex_stat/br_me_comex_stat__dicionario.sql b/models/br_me_comex_stat/br_me_comex_stat__dicionario.sql index 22a4c2c7..57ac30e8 100644 --- a/models/br_me_comex_stat/br_me_comex_stat__dicionario.sql +++ b/models/br_me_comex_stat/br_me_comex_stat__dicionario.sql @@ -6,8 +6,14 @@ }} select safe_cast(id_tabela as string) id_tabela, - safe_cast(coluna as string) coluna, - safe_cast(chave as string) chave, + safe_cast(coluna as string) nome_coluna, + safe_cast( + case + when coluna = 'id_urf' + then lpad(safe_cast(chave as string), 6, '0') + else safe_cast(chave as string) + end as string + ) chave, safe_cast(cobertura_temporal as string) cobertura_temporal, safe_cast(valor as string) valor from `basedosdados-staging.br_me_comex_stat_staging.dicionario` as t diff --git a/models/br_me_comex_stat/schema.yml b/models/br_me_comex_stat/schema.yml index bd3ed0af..5c7b1b9b 100644 --- a/models/br_me_comex_stat/schema.yml +++ b/models/br_me_comex_stat/schema.yml @@ -203,11 +203,11 @@ models: columns: - name: id_tabela description: ID da tabela - - name: coluna + - name: nome_coluna description: Nome da coluna - name: chave description: Chave - name: cobertura_temporal - description: Cobertura Temporal + description: Cobertura temporal - name: valor description: Valor