You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "slim bouguerra (JIRA)" <ji...@apache.org> on 2017/05/24 22:09:04 UTC

[jira] [Updated] (CALCITE-1805) druid adaptere is using in a wrong way count function

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

slim bouguerra updated CALCITE-1805:
------------------------------------
    Description: 
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";
    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");
  }{code} First test will pass while the second will not.   

  was:
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 exists in druid. The count aggregator does only work as count(*). 
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";
    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");
  }{code} First test will pass while the second will not.   


> druid adaptere is using in a wrong way count function 
> ------------------------------------------------------
>
>                 Key: CALCITE-1805
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1805
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.12.0
>            Reporter: slim bouguerra
>            Assignee: Julian Hyde
>
> 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";
>     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");
>   }{code} First test will pass while the second will not.   



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)