Skip to content

Commit 5889c17

Browse files
committed
remove inner user join
1 parent b3b5cdf commit 5889c17

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

metadata-ingestion/src/datahub/ingestion/source/snowflake/snowflake_query.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -588,13 +588,9 @@ def usage_per_object_per_time_bucket_for_time_window(
588588
query_id,
589589
query_start_time,
590590
user_name,
591-
NVL(USERS.email, CONCAT(user_name, '{email_domain}')) AS user_email,
592591
{objects_column}
593592
from
594593
snowflake.account_usage.access_history
595-
LEFT JOIN
596-
snowflake.account_usage.users USERS
597-
ON access_history.user_name = users.name
598594
WHERE
599595
query_start_time >= to_timestamp_ltz({start_time_millis}, 3)
600596
AND query_start_time < to_timestamp_ltz({end_time_millis}, 3)
@@ -651,7 +647,7 @@ def usage_per_object_per_time_bucket_for_time_window(
651647
DATE_TRUNC('{time_bucket_size.value}', CONVERT_TIMEZONE('UTC', query_start_time)) AS bucket_start_time,
652648
count(distinct(query_id)) AS total_queries,
653649
user_name,
654-
ANY_VALUE(users.email) AS user_email
650+
ANY_VALUE(NVL(users.email, CONCAT(user_name, '{email_domain}'))) AS user_email
655651
FROM
656652
object_access_history
657653
LEFT JOIN

0 commit comments

Comments
 (0)