Skip to content

Commit

Permalink
ignore tables in referenced_tables array if they're destination tables
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldeleo authored Sep 29, 2023
1 parent 428c310 commit 3569dcf
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_ORGANIZATION jbo,
UNNEST(referenced_tables) table
WHERE
DATE(creation_time) >= CURRENT_DATE - num_days_to_scan
AND (
table.project_id||table.dataset_id||table.table_id
<> destination_table.project_id||destination_table.dataset_id||destination_table.table_id
)
AND job_type = 'QUERY'
AND statement_type != 'SCRIPT'
AND NOT cache_hit
Expand Down

0 comments on commit 3569dcf

Please sign in to comment.