-
-
Save ivanpk/b3f70fccfdc35ed604505826b9c61b7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH | |
user_ids AS ( | |
SELECT | |
'user-id-1' AS user_id | |
UNION ALL | |
SELECT | |
'user-id-1' AS user_id | |
UNION ALL | |
SELECT | |
'user-id-2' AS user_id ) | |
SELECT | |
HLL_COUNT.init(user_id) as HyperLogLog_Sketch, | |
HLL_COUNT.extract(HLL_COUNT.init(user_id)) as Distinct_Count_from_HyperLogLog_sketch | |
FROM | |
user_ids |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment