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

xiong duan commented on CALCITE-4997:
-------------------------------------

Fixed in 
[5b2de4e|https://github.com/apache/calcite/commit/5b2de4ef5c9447bc9f7aff98dd049bd32af5c53d].
 Thanks for your review [~asolimando].

> 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: Jiajun Xie
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Summary:  Some engines(Hive,Spark,BigQuery,Oracle,Snowflake) 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 the same as 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)

Reply via email to