Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYNSD-893] Add query for disjointed name #31

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
thomasyu888 marked this conversation as resolved.
Show resolved Hide resolved
-- 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