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 2022/01/10 16:32:14 UTC

[GitHub] [druid] cryptoe edited a comment on pull request #12078: Grouping on arrays as arrays

cryptoe edited a comment on pull request #12078:
URL: https://github.com/apache/druid/pull/12078#issuecomment-1009068625


   
   > The use-case is that some of the values in the MV field are not interesting for a specific query, and we would like to ignore them for the purpose of the GROUP BY. They are kept there because those ignored tags might be used for filtering, or might be used for GROUP BY when performing a different query.
   > 
   > An example query, using the example data appearing at the top of this PR:
   > 
   > SELECT MV_FILTER_ONLY(tags, ARRAY['t3', 't4']), COUNT(*) FROM test GROUP BY 1
   > 
   > with your new code enabled, I would expect the following to return:
   > 
   > ```
   > ["t3"],       1            (from row1)
   > ["t3", "t4"], 1            (from row2)
   > null,         2            (from row3+row4)
   > ```
   
   For the first cut, I have not enabled expression as part of the MV_TO_ARRAY(). It has to be a native multiValueString/String col. 
   FWIF @dbardbar you can query like
   ```
   SELECT MV_TO_ARRAY(dim3), SUM(cnt) FROM druid.numfoo where MV_CONTAINS(dim3, ARRAY['b']) GROUP BY 1 
   ```
   


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