xiangfu0 commented on issue #5069:
URL: https://github.com/apache/pinot/issues/5069#issuecomment-4113972971

   The new `filterMv` function in #17659 provides a workaround for this. When 
GROUP BY explodes MV values into separate groups, you can use `filterMv` to 
control exactly which elements participate in grouping:
   
   ```sql
   -- Instead of GROUP BY array_col which explodes all elements:
   SELECT filterMv(array_col, 'v = 1') AS filtered, COUNT(foo)
   FROM myTable
   GROUP BY filterMv(array_col, 'v = 1')
   ```
   
   This filters the MV array at the element level *before* grouping, so only 
matching elements appear as group keys. `filterMv` supports `=`, `!=`, `>`, 
`>=`, `<`, `<=`, `IN`, `NOT IN`, `BETWEEN`, `REGEXP_LIKE`, and compound 
predicates with `AND`/`OR`/`NOT`.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to