phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ethan Wang (JIRA)" <>
Subject [jira] [Updated] (PHOENIX-418) Support approximate COUNT DISTINCT
Date Thu, 24 Aug 2017 18:23:00 GMT


Ethan Wang updated PHOENIX-418:
    Attachment: PHOENIX-418-v5.patch

Thanks for suggestions [~jamestaylor].

bq. Make sure to call TestUtil.analyzeTable(connection, fullTableName) prior to running your
TABLESAMPLE queries. You'll get more rows back, since you'll have guideposts in addition to
region boundaries.

If I understand this part right, within the test for approximate count distinct, table sampling
technique was not used since HyperLogLog doesn't rely on sampling (hence no run time speed
gain during counting). 

> Support approximate COUNT DISTINCT
> ----------------------------------
>                 Key: PHOENIX-418
>                 URL:
>             Project: Phoenix
>          Issue Type: Task
>            Reporter: James Taylor
>            Assignee: Ethan Wang
>              Labels: gsoc2016
>         Attachments: PHOENIX-418-v1.patch, PHOENIX-418-v2.patch, PHOENIX-418-v3.patch,
PHOENIX-418-v4.patch, PHOENIX-418-v5.patch
> Support an "approximation" of count distinct to prevent having to hold on to all distinct
values (since this will not scale well when the number of distinct values is huge). The Apache
Drill folks have had some interesting discussions on this [here](
They recommend using  [Welford's method](
I'm open to having a config option that uses exact versus approximate. I don't have experience
implementing an approximate implementation, so I'm not sure how much state is required to
keep on the server and return to the client (other than realizing it'd be much less that returning
all distinct values and their counts).

This message was sent by Atlassian JIRA

View raw message