-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
queries/models/protecao_social_cadunico/utils/check_layout_columns_not_in_sheets.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,25 @@ | ||
WITH layout_unique_columns AS ( | ||
SELECT | ||
column as coluna_layout, | ||
max(descricao) as descricao | ||
FROM `rj-smas.protecao_social_cadunico_staging.layout` | ||
GROUP BY 1 | ||
), | ||
|
||
sheets_unique_columns AS ( | ||
SELECT | ||
column as coluna_sheets | ||
FROM `rj-smas.protecao_social_cadunico_staging.layout_dicionario_colunas` | ||
|
||
) | ||
|
||
SELECT | ||
|
||
t2.coluna_sheets, | ||
t1.coluna_layout, | ||
t1.descricao | ||
FROM layout_unique_columns t1 | ||
FULL OUTER JOIN sheets_unique_columns t2 | ||
ON t1.coluna_layout = t2.coluna_sheets | ||
WHERE coluna_sheets IS NULL | ||
ORDER BY coluna_layout |
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
queries/models/protecao_social_cadunico/utils/tables_last_update.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,6 @@ | ||
SELECT | ||
creation_time as last_update, | ||
table_schema as dataset_id, | ||
table_name as table_id | ||
FROM `rj-smas.protecao_social_cadunico.INFORMATION_SCHEMA.TABLES` | ||
ORDER BY 1 |