You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "xiejiajun (Jira)" <ji...@apache.org> on 2022/02/09 09:34:00 UTC

[jira] [Comment Edited] (CALCITE-4997) Keep APPROX_COUNT_DISTINCT in some SqlDialects

    [ https://issues.apache.org/jira/browse/CALCITE-4997?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17489399#comment-17489399 ] 

xiejiajun edited comment on CALCITE-4997 at 2/9/22, 9:33 AM:
-------------------------------------------------------------

[~nobigo] I added some summaries, thank you for your review.


was (Author: jiajunbernoulli):
[~nobigo] I added some summaries

> Keep APPROX_COUNT_DISTINCT in some SqlDialects
> ----------------------------------------------
>
>                 Key: CALCITE-4997
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4997
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.29.0
>            Reporter: xiejiajun
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Summary:  Some engines support APPROX_COUNT_DISTINCT function, while others do not. So we can use the parameter *SqlDialect#supportsApproxCountDistinct* to control whether to use APPROX_COUNT_DISTINCT(It is APPROX_DISTINCT for Presto).
> ----
> Problem: Before fix for all SqlDialects
> {code:java}
> SELECT APPROX_COUNT_DISTINCT(product_id)
> FROM foodmart.product
> {code}
> will be 
> {code:java}
> SELECT COUNT(DISTINCT product_id)
> FROM foodmart.product
> {code}
> This can cause many tasks to run too slowly.
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)