Skip to content

Instantly share code, notes, and snippets.

@lgavish
Created May 7, 2021 16:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Extracting copy logs from Snowflake
SELECT
"FILE_NAME",
"STAGE_LOCATION",
"LAST_LOAD_TIME",
"ROW_COUNT",
"FILE_SIZE",
"ERROR_COUNT",
"STATUS",
"TABLE_CATALOG_NAME",
"TABLE_SCHEMA_NAME",
"TABLE_NAME",
"PIPE_CATALOG_NAME",
"PIPE_SCHEMA_NAME",
"PIPE_NAME",
"PIPE_RECEIVED_TIME"
FROM snowflake.account_usage.copy_history
WHERE
LAST_LOAD_TIME between to_timestamp_ltz('2021-01-01 00:00:00.000000+00:00') AND to_timestamp_ltz('2021-01-01 01:00:00.000000+00:00')
AND STATUS != 'load failed'
ORDER BY LAST_LOAD_TIME DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment