Skip to content

Commit

Permalink
Merge pull request #31 from Sage-Bionetworks/synsd-893-disjointed-fil…
Browse files Browse the repository at this point in the history
…e-name-to-entity-name

[SYNSD-893] Add query for disjointed name
  • Loading branch information
thomasyu888 authored May 14, 2024
2 parents 405e27c + e38cba5 commit 3efd537
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions analytics/find_disjointed_file_name_to_download_name.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- This was a small query put together for https://sagebionetworks.jira.com/browse/SYNSD-893
-- The query is looking for files that have a different name than the entity they are associated with
USE ROLE DATA_ENGINEER;
USE WAREHOUSE COMPUTE_XSMALL;
USE DATABASE SYNAPSE_DATA_WAREHOUSE;
USE SCHEMA SYNAPSE;

-- This is looking by parent_ID
SELECT ENTITY_LATEST.id, ENTITY_LATEST.name, FILE_LATEST.FILE_NAME, FILE_LATEST.CONTENT_MD5 FROM synapse_data_warehouse.synapse.node_latest ENTITY_LATEST
inner join
synapse_data_warehouse.synapse.file_latest FILE_LATEST
on
ENTITY_LATEST.file_handle_id = FILE_LATEST.ID
WHERE ENTITY_LATEST.PARENT_ID = 51286684
AND FILE_LATEST.FILE_NAME != ENTITY_LATEST.name

0 comments on commit 3efd537

Please sign in to comment.