You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kgyrtkirk (via GitHub)" <gi...@apache.org> on 2023/08/23 14:19:38 UTC

[I] Incorrect results for grouping sets with count distinct query (druid)

kgyrtkirk opened a new issue, #14899:
URL: https://github.com/apache/druid/issues/14899

   noticed this while investigating #14748 
   ```
   select dim1,dim2,count(1),count(distinct m1) from druid.foo where (dim1='abc' or dim1='def' or dim2 ='abc' ) group by grouping sets ((dim1),(dim2),())
   ```
   
   results without approximate count distinct:
   
   ```
   new Object[]{"abc", null, 1L, 1L},
   new Object[]{"def", "abc", 1L, 1L}
   ```
   
   * which is invalid ; as there may not be any result of this query which have both `dim1` and `dim2` as not null
   * with approximate on - the results are more sane; 
   
   
   ```
     @Test
     public void test()
     {
       cannotVectorize();
       requireMergeBuffers(3);
   
       testBuilder().plannerConfig(
           PLANNER_CONFIG_DEFAULT.withOverrides(
               ImmutableMap.of(
                  PlannerConfig.CTX_KEY_USE_APPROXIMATE_COUNT_DISTINCT, false))
           )
       .sql("select dim1,dim2,count(1),count(distinct m1) from druid.foo where (dim1='abc' or dim1='def' or dim2 ='abc' ) group by grouping sets ((dim1),(dim2),())")
       .expectedResults(ImmutableList.of(
           // fill this in later
       ))
       .run();
     }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [I] Incorrect results for grouping sets with count distinct query (druid)

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #14899:
URL: https://github.com/apache/druid/issues/14899#issuecomment-2138450051

   This issue has been marked as stale due to 280 days of inactivity.
   It will be closed in 4 weeks if no further activity occurs. If this issue is still
   relevant, please simply write any comment. Even if closed, you can still revive the
   issue at any time or discuss it on the dev@druid.apache.org list.
   Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org