You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/12/09 08:01:39 UTC

[GitHub] [incubator-druid] teyeheimans opened a new issue #9000: Druid GroupBy query gives different response when changing columns in the limitSpec.

teyeheimans opened a new issue #9000: Druid GroupBy query gives different response when changing columns in the limitSpec. 
URL: https://github.com/apache/incubator-druid/issues/9000
 
 
   I have a question regarding an Apache Druid incubating query. 
   
   I have a simple group by to select the number of calls per operator. See here my query:
   
       {
           "queryType": "groupBy",
           "dataSource": "ivr-calls",
           "intervals": [
               "2019-12-06T00:00:00.000Z/2019-12-07T00:00:00.000Z"
           ],
           "dimensions": [
               {
                   "type": "lookup",
                   "dimension": "operator_id",
                   "outputName": "value",
                   "name": "ivr_operator",
                   "replaceMissingValueWith": "Unknown"
               },
               {
                   "type": "default",
                   "dimension": "operator_id",
                   "outputType": "long",
                   "outputName": "id"
               }
           ],
           "granularity": "all",
           "aggregations": [
               {
                   "type": "longSum",
                   "name": "calls",
                   "fieldName": "calls"
               }
           ],
           "limitSpec": {
               "type": "default",
               "limit": 999999,
               "columns": [
                   {
                       "dimension": "value",
                       "direction": "ascending",
                       "dimensionOrder": "numeric"
                   }
               ]
           }
       }
   
   In this query I order the result by the "value" dimension, I receive 218 results.
   I noticed that some of the records are duplicate. (I see some operators two times in my resultset). This is strange because in my experience all dimensions which you select are also used for grouping by. So, they should be unique.
   
   If I add an order by to the "id" dimension, I receive 183 results (which is expected):
   
       "columns": [
           {
               "dimension": "value",
               "direction": "ascending",
               "dimensionOrder": "numeric"
           },
           {
               "dimension": "id",
               "direction": "ascending",
               "dimensionOrder": "numeric"
           }
       ]
   
   The documentation tells me nothing about this strange behavior (https://druid.apache.org/docs/latest/querying/limitspec.html). 
   
   My previous experience with druid is that the order by is just "ordering".
   
   I am running druid version 0.15.0-incubating-iap9.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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