Skip to content

Commit

Permalink
Fixed deletion date in query
Browse files Browse the repository at this point in the history
  • Loading branch information
wwyc committed Apr 17, 2024
1 parent 060025e commit 6412e94
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def create_query(date, source_project, tmp_table_name):
CAST(ARRAY_AGG(
IF(
key = 'deprecated', value, NULL) IGNORE NULLS
ORDER BY value)[SAFE_OFFSET(0)] AS BOOLEAN) AS deprecated
ORDER BY value)[SAFE_OFFSET(0)] AS BOOLEAN) AS deprecated,
CAST(ARRAY_AGG(
IF(
key = 'deletion_date', value, NULL) IGNORE NULLS
Expand Down Expand Up @@ -116,6 +116,7 @@ def create_query(date, source_project, tmp_table_name):
table_type,
owners,
deprecated,
deletion_date
FROM `{source_project}.region-us.INFORMATION_SCHEMA.TABLES`
LEFT JOIN labels_agg
USING (table_catalog, table_schema, table_name)
Expand All @@ -131,6 +132,7 @@ def create_query(date, source_project, tmp_table_name):
table_type,
owners,
deprecated,
deletion_date,
last_used_date
FROM table_info
LEFT JOIN max_job_creation_date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ fields:
type: BOOLEAN
description: Whether the table has been deprecated and pending deletion

- mode: NULLABLE
name: deletion_date
type: DATE
description: The date when the tables was scheduled for deletion

- mode: NULLABLE
name: last_used_date
type: DATE
Expand Down

0 comments on commit 6412e94

Please sign in to comment.