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 2020/02/23 13:05:05 UTC

[GitHub] [druid] hotdust opened a new issue #9393: if group by Numeric dimension and String dimension, only return 100 results

hotdust opened a new issue #9393: if group by Numeric dimension and String dimension, only return 100 results
URL: https://github.com/apache/druid/issues/9393
 
 
   Hey, I'm researching Druid. I have questions about SQL.
   
   # Version
   0.17.0
   
   # Deployment
   nano-quickstart
   
   
   # Data and Schema
   1. Data is "quickstart/tutorial/wikiticker-2015-09-12-sampled.json.gz".
   2. Data is loaded into Druid by [Tutorial: Loading a file](https://druid.apache.org/docs/latest/tutorials/tutorial-batch.html), and Rollup function is turned off. Schema as following:
   ```
   {
     "type": "index_parallel",
     "ioConfig": {
       "type": "index_parallel",
       "inputSource": {
         "type": "local",
         "filter": "wikiticker-2015-09-12-sampled.json.gz",
         "baseDir": "quickstart/tutorial"
       },
       "inputFormat": {
         "type": "json"
       }
     },
     "tuningConfig": {
       "type": "index_parallel",
       "partitionsSpec": {
         "type": "dynamic"
       }
     },
     "dataSchema": {
       "dataSource": "wikiticker",
       "granularitySpec": {
         "type": "uniform",
         "queryGranularity": "NONE",
         "rollup": false,
         "segmentGranularity": "DAY"
       },
       "timestampSpec": {
         "column": "time",
         "format": "iso"
       },
       "dimensionsSpec": {
         "dimensions": [
           {
             "type": "long",
             "name": "added"
           },
           "channel",
           "cityName",
           "comment",
           "countryIsoCode",
           "countryName",
           {
             "type": "long",
             "name": "deleted"
           },
           {
             "type": "long",
             "name": "delta"
           },
           "isAnonymous",
           "isMinor",
           "isNew",
           "isRobot",
           "isUnpatrolled",
           "namespace",
           "page",
           "regionIsoCode",
           "regionName",
           "user"
         ]
       }
     }
   }
   ```
   
   
   
   # Questions
   ## Question 1: 
   Why the following SQL always return 100 results, no matter add limit clause or not?
   ( delta is Numeric, and user is String. Both are dimensions.)
   
   SQL:
   > SELECT delta, user FROM "wikiticker" GROUP BY delta, user
   
   Results:
   ![image](https://user-images.githubusercontent.com/18543769/75105649-e7875580-5650-11ea-9192-0fb222971285.png)
   
   
   Natvie SQL:
   ```
   {
     "queryType": "groupBy",
     "dataSource": {
       "type": "table",
       "name": "wikiticker"
     },
     "intervals": {
       "type": "intervals",
       "intervals": [
         "-146136543-09-08T08:23:32.096Z/146140482-04-24T15:36:27.903Z"
       ]
     },
     "virtualColumns": [],
     "filter": null,
     "granularity": {
       "type": "all"
     },
     "dimensions": [
       {
         "type": "default",
         "dimension": "delta",
         "outputName": "d0",
         "outputType": "LONG"
       },
       {
         "type": "default",
         "dimension": "user",
         "outputName": "d1",
         "outputType": "STRING"
       }
     ],
     "aggregations": [],
     "postAggregations": [],
     "having": null,
     "limitSpec": {
       "type": "NoopLimitSpec"
     },
     "context": {
       "sqlQueryId": "4449f325-3262-4f81-811d-acbb0600d97c"
     },
     "descending": false
   }
   ```
   
   ## Question 2
   If changes Group by dimensions orders( delta, user ->  user, delta), SQL will return all results.
   It looks like SQL will return all results if String dimension is first dimension in `Group by and Select clause`.
   How come different dimension orders will generate different results?
   > SELECT user, delta FROM "wikiticker" GROUP BY user, delta

----------------------------------------------------------------
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


[GitHub] [druid] BeanNan commented on issue #9393: if group by Numeric dimension and String dimension, only return 100 results

Posted by GitBox <gi...@apache.org>.
BeanNan commented on issue #9393: if group by Numeric dimension and String dimension, only return 100 results
URL: https://github.com/apache/druid/issues/9393#issuecomment-597532038
 
 
   ![image](https://user-images.githubusercontent.com/40813941/76402566-8f758080-63be-11ea-8887-a32a0b55d100.png)
   I also reproduced it once, but it is not stable

----------------------------------------------------------------
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


[GitHub] [druid] hotdust commented on issue #9393: if group by Numeric dimension and String dimension, only return 100 results

Posted by GitBox <gi...@apache.org>.
hotdust commented on issue #9393: if group by Numeric dimension and String dimension, only return 100 results
URL: https://github.com/apache/druid/issues/9393#issuecomment-599323821
 
 
   > I would like to ask, what is your JDK version, zulu8 or openjdk8?
   
   Oracle JDK. detail as following:
   ```
   java version "1.8.0_121"
   Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
   Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
   ```

----------------------------------------------------------------
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


[GitHub] [druid] BeanNan commented on issue #9393: if group by Numeric dimension and String dimension, only return 100 results

Posted by GitBox <gi...@apache.org>.
BeanNan commented on issue #9393: if group by Numeric dimension and String dimension, only return 100 results
URL: https://github.com/apache/druid/issues/9393#issuecomment-597530798
 
 
   I would like to ask, what is your JDK version, zulu8 or openjdk8?

----------------------------------------------------------------
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


[GitHub] [druid] BeanNan commented on issue #9393: if group by Numeric dimension and String dimension, only return 100 results

Posted by GitBox <gi...@apache.org>.
BeanNan commented on issue #9393: if group by Numeric dimension and String dimension, only return 100 results
URL: https://github.com/apache/druid/issues/9393#issuecomment-597519884
 
 
   I also encountered the same problem, you can try to close the **query cache** in the console to see if the same problem will occur

----------------------------------------------------------------
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