Skip to content

Commit

Permalink
feat: add utils queries
Browse files Browse the repository at this point in the history
  • Loading branch information
d116626 committed Feb 6, 2024
1 parent a6d59b4 commit 35a4855
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
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
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

0 comments on commit 35a4855

Please sign in to comment.