Skip to content

Commit

Permalink
fix: edge case in Snowflake information_schema.last_altered value (#360)
Browse files Browse the repository at this point in the history
Signed-off-by: Tao Feng <fengtao04@gmail.com>
  • Loading branch information
instazackwu committed Sep 7, 2020
1 parent 4113cfd commit c3e713e
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -21,6 +21,7 @@ class SnowflakeTableLastUpdatedExtractor(Extractor):
snowflake-connector-python
snowflake-sqlalchemy
"""
# https://docs.snowflake.com/en/sql-reference/info-schema/views.html#columns
# 'last_altered' column in 'TABLES` metadata view under 'INFORMATION_SCHEMA' contains last time when the table was
# updated (both DML and DDL update). Below query fetches that column for each table.
SQL_STATEMENT = """
Expand All @@ -47,7 +48,7 @@ class SnowflakeTableLastUpdatedExtractor(Extractor):
DEFAULT_CLUSTER_NAME = 'master'

DEFAULT_CONFIG = ConfigFactory.from_dict(
{WHERE_CLAUSE_SUFFIX_KEY: ' ',
{WHERE_CLAUSE_SUFFIX_KEY: ' WHERE t.last_altered IS NOT NULL ',
CLUSTER_KEY: DEFAULT_CLUSTER_NAME,
USE_CATALOG_AS_CLUSTER_NAME: True,
DATABASE_KEY: 'snowflake',
Expand Down

0 comments on commit c3e713e

Please sign in to comment.