Skip to content

Instantly share code, notes, and snippets.

@lgavish
Created May 7, 2021 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgavish/0ef3dc20fbb6f71e87e0a8d2ab7223b3 to your computer and use it in GitHub Desktop.
Save lgavish/0ef3dc20fbb6f71e87e0a8d2ab7223b3 to your computer and use it in GitHub Desktop.
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