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/06/16 03:51:44 UTC

[GitHub] [druid] gianm commented on issue #10011: Druid SQL Differing Results When Grouping By 1 Column vs 1 Col With Dummy Column

gianm commented on issue #10011:
URL: https://github.com/apache/druid/issues/10011#issuecomment-644515235


   Hmm, based on my understanding of how multi-value dimensions work, I would have expected that both queries should return two rows. The reason is that the filter selects the one row we have (because `col1` contains an `"a"`) but then we group on the full contents of the column (both `"a"` and `"b"`).
   
   It looks like the unexpected one-row return is a case of the SQL planner tweaking the query in a way that doesn't respect multi-value behaviors. You can see it created a virtual column that was just a constant `"a"`:
   
   ```java
       {
         "type": "expression",
         "name": "v0",
         "expression": "'a'",
         "outputType": "STRING"
       }
   ```
   
   And then grouped on that rather than on `col1` (note that `dimension` is `v0` rather than `col1`):
   
   ```java
       {
         "type": "default",
         "dimension": "v0",
         "outputName": "d0",
         "outputType": "STRING"
       }
   ```
   
   This transformation is valid if `col1` is singly-valued, but invalid if `col1` is multi-valued.
   
   @clintropolis did the initial work to make the SQL layer more multi-value-aware — any idea where we might want to look to fix this?


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



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