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 2018/10/31 01:56:07 UTC

[GitHub] vogievetsky opened a new issue #6556: Unexpected results from concat on a real and fake (null) column

vogievetsky opened a new issue #6556: Unexpected results from concat on a real and fake (null) column
URL: https://github.com/apache/incubator-druid/issues/6556
 
 
   So check out this query, note that `channel` exists but `foo` and `bar` do not
   
   ```json
   {
     "queryType": "topN",
     "dataSource": "wikipedia",
     "intervals": "2015-09-12T00Z/2015-09-13T00Z",
     "granularity": "all",
     "virtualColumns": [
       {
         "type": "expression",
         "name": "v:channel",
         "expression": "concat(\"foo\",\"channel\",\"bar\")",
         "outputType": "STRING"
       }
     ],
     "dimension": {
       "type": "default",
       "dimension": "v:channel",
       "outputName": "channel",
       "outputType": "STRING"
     },
     "aggregations": [
       {
         "name": "count",
         "type": "count"
       }
     ],
     "metric": "count",
     "threshold": 5
   }
   ```
   
   This returns:
   
   ```json
   [ {
     "timestamp" : "2015-09-12T00:46:00.000Z",
     "result" : [ {
       "count" : 114006,
       "channel" : "enenen"
     }, {
       "count" : 99004,
       "channel" : "vivivi"
     }, {
       "count" : 25022,
       "channel" : "dedede"
     }, {
       "count" : 21191,
       "channel" : "frfrfr"
     }, {
       "count" : 13945,
       "channel" : "rururu"
     } ]
   } ]
   ```
   
   The expected return is:
   
   ```json
   [ {
     "timestamp" : "2015-09-12T00:46:00.000Z",
     "result" : [ {
       "count" : 114006,
       "channel" : "en"
     }, {
       "count" : 99004,
       "channel" : "vi"
     }, {
       "count" : 25022,
       "channel" : "de"
     }, {
       "count" : 21191,
       "channel" : "fr"
     }, {
       "count" : 13945,
       "channel" : "ru"
     } ]
   } ]
   ```
   
   The issue is obviously with `"expression": "concat(\"foo\",\"channel\",\"bar\")"` maybe there is some buggy optimization? If you have a concat with two actual columns this does not happen.
   This appears to be an issue in Druid 0.12.x and 0.13.x.
   
   This is not an issue with SQL as SQL does not let you put in a column that does not exist.
   Wait.... that does not sound right.... what if you have a column that exists in one segment and not in another and you query over the segment where the column does not exist?
   
   ![image](https://user-images.githubusercontent.com/177816/47761362-4dd6b080-dc75-11e8-916a-7e88728b362f.png)
   
   Hot DANG! Seems to be the same issue in SQL... not surprising.
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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