Created
May 5, 2021 21:09
-
-
Save lgavish/c4e79f114d113d3973e217c2d601e116 to your computer and use it in GitHub Desktop.
Extracting table freshness and volume from Snowflake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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