Skip to content

Instantly share code, notes, and snippets.

@lgavish
Created May 5, 2021 21:09
  • 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 table freshness and volume from Snowflake
SELECT
TABLE_CATALOG,
TABLE_SCHEMA,
TABLE_NAME,
ROW_COUNT,
BYTES,
CONVERT_TIMEZONE('UTC', CREATED) as CREATED,
CONVERT_TIMEZONE('UTC', LAST_ALTERED) as LAST_ALTERED
FROM "ANALYTICS".information_schema.tables
WHERE
table_schema NOT IN ('INFORMATION_SCHEMA')
AND TABLE_TYPE NOT IN ('VIEW', 'EXTERNAL TABLE')
ORDER BY TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment