Skip to content

Commit

Permalink
Merge branch 'datahub-project:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
treff7es authored Dec 19, 2023
2 parents f6f3b28 + 94a1603 commit 9fbbca4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion datahub-web-react/src/app/identity/user/UserList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const UserList = () => {
query: (query?.length && query) || undefined,
},
},
fetchPolicy: (query?.length || 0) > 0 ? 'no-cache' : 'cache-first',
fetchPolicy: 'no-cache',
});

const totalUsers = usersData?.listUsers?.total || 0;
Expand Down
26 changes: 16 additions & 10 deletions metadata-ingestion/src/datahub/ingestion/source/redshift/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,18 @@
sq.endtime AS endtime,
'insert' AS operation_type
FROM
stl_insert si
(select userid, query, sum(rows) as rows, tbl
from stl_insert si
where si.rows > 0
AND si.starttime >= '{start_time}'
AND si.starttime < '{end_time}'
group by userid, query, tbl
) as si
JOIN svv_table_info sti ON si.tbl = sti.table_id
JOIN stl_query sq ON si.query = sq.query
JOIN svl_user_info sui ON sq.userid = sui.usesysid
WHERE
si.starttime >= '{start_time}'
AND si.starttime < '{end_time}'
AND si.rows > 0
AND sq.aborted = 0)
sq.aborted = 0)
UNION
(SELECT
DISTINCT sd.userid AS userid,
Expand All @@ -109,15 +112,18 @@
sq.endtime AS endtime,
'delete' AS operation_type
FROM
stl_delete sd
(select userid, query, sum(rows) as rows, tbl
from stl_delete sd
where sd.rows > 0
AND sd.starttime >= '{start_time}'
AND sd.starttime < '{end_time}'
group by userid, query, tbl
) as sd
JOIN svv_table_info sti ON sd.tbl = sti.table_id
JOIN stl_query sq ON sd.query = sq.query
JOIN svl_user_info sui ON sq.userid = sui.usesysid
WHERE
sd.starttime >= '{start_time}'
AND sd.starttime < '{end_time}'
AND sd.rows > 0
AND sq.aborted = 0)
sq.aborted = 0)
ORDER BY
endtime DESC
""".strip()
Expand Down

0 comments on commit 9fbbca4

Please sign in to comment.