3
votes

I am hitting the "Resources exceeded during query execution" error when executing this query:

SELECT date_time,Atok,Segment,
COUNT(Distinct GoogId) AS DistUsers,
SUM(CASE WHEN EventType=1 THEN 1 ELSE 0 END) AS CntImp,
SUM(CASE WHEN EventType=2 THEN 1 ELSE 0 END) AS CntClick,
SUM(CASE WHEN EventType=3 THEN 1 ELSE 0 END) AS CntVisit,
SUM(CASE WHEN EventType=4 THEN 1 ELSE 0 END) AS CntConv,
FROM LogData.unified_logs
GROUP EACH BY 1,2,3;

Any ideas?

1

1 Answers

2
votes

Count distinct is the culprit... you should be able to create a subquery that does an extra group (each) by that computes the distinct users.