You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Gian Merlino (JIRA)" <ji...@apache.org> on 2017/01/18 19:46:26 UTC

[jira] [Commented] (CALCITE-1588) Add SQL syntax to allow approximate LIMIT and distinct-COUNT

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

Gian Merlino commented on CALCITE-1588:
---------------------------------------

In Druid's SQL dialect, for distinct-count, even if you disable useApproximateCountDistinct you can still get the approximate algo by doing APPROX_COUNT_DISTINCT(col). We chose that since it seems to be the unofficial standard (bigquery, oracle, memsql all call it that).
We don't have anything in the dialect to get approximate topNs if you disabled the useApproximateTopN property though. Or, for that matter, to get exact ones if you enabled the property.

> Add SQL syntax to allow approximate LIMIT and distinct-COUNT
> ------------------------------------------------------------
>
>                 Key: CALCITE-1588
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1588
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>
> Add SQL syntax to allow approximate LIMIT and distinct-COUNT. These will set the properties specified in CALCITE-1587. By default the properties are false, so the query will return exact results.
> Exact syntax is to be decided. It could be at the top of the query (therefore affecting every LIMIT or aggregate in the query) or it could be more localized (e.g. {{COUNT(DISTINCT customerId) APPROXIMATE (WITHIN 10 PERCENT)}}).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)