From fe173faf84716288e2f417259fd29018dfce51dc Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Wed, 12 Feb 2025 15:10:58 -0800 Subject: [PATCH] fix(ingest/snowflake): order queries for queries_v2 (#12551) --- .../datahub/ingestion/source/snowflake/snowflake_queries.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metadata-ingestion/src/datahub/ingestion/source/snowflake/snowflake_queries.py b/metadata-ingestion/src/datahub/ingestion/source/snowflake/snowflake_queries.py index eb015f9d13..b77cc1b941 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/snowflake/snowflake_queries.py +++ b/metadata-ingestion/src/datahub/ingestion/source/snowflake/snowflake_queries.py @@ -731,6 +731,9 @@ fingerprinted_queries as ( JOIN filtered_access_history a USING (query_id) ) SELECT * FROM query_access_history +-- Our query aggregator expects the queries to be added in chronological order. +-- It's easier for us to push down the sorting to Snowflake/SQL instead of doing it in Python. +ORDER BY QUERY_START_TIME ASC """