[ 
https://issues.apache.org/jira/browse/CALCITE-1805?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jesus Camacho Rodriguez reopened CALCITE-1805:
----------------------------------------------

> Druid adapter incorrectly pushes down "COUNT(c)"; Druid only supports 
> "COUNT(*)"
> --------------------------------------------------------------------------------
>
>                 Key: CALCITE-1805
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1805
>             Project: Calcite
>          Issue Type: Bug
>          Components: druid
>    Affects Versions: 1.12.0
>            Reporter: slim bouguerra
>            Assignee: slim bouguerra
>             Fix For: 1.13.0
>
>
> Currently queries like 
> {code}select count(column) from table{code} is pushed to druid as timeseries 
> with an aggregator {code} 
> {"type":"count","name":"EXPR$0","fieldName":"countryName"} {code}
> Such an aggregator does not exist in druid. The count aggregator does only 
> work as {code} count(*) {code}. 
> here is a test case that summarize the issue.
> {code}  @Test public void testCount() {
>     final String sql = "SELECT count(\"countryName\") FROM (SELECT 
> \"countryName\" FROM \"wikiticker\" WHERE \"countryName\"  IS NOT NULL) as 
> a"; // correct count
>     sql(sql, WIKI_AUTO2).returnsUnordered("EXPR$0=3799");
>     final String sql2 = "SELECT count(\"countryName\") FROM (SELECT 
> \"countryName\" FROM \"wikiticker\") as a";
>     sql(sql2, WIKI_AUTO2).returnsUnordered("EXPR$0=3799"); // it will fail
>   }{code} First test will pass while the second will not.   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to