https://pinot.apache.org/ logo
k

Ken Krugler

01/08/2021, 1:24 AM
If I do a query with a
where mvfield in ('a', 'b') group by mvfield
, and
mvfield
is a multi-valued field, I get a result with groups for values from
mvfield
that aren’t in my where clause. I assume I’m getting groups for every value found in
mvfield
from rows where
mvfield
contains a match for my filter, but it seems wrong…am I missing something?
m

Mayank

01/08/2021, 1:26 AM
You need the
value_in
udf. Let me find an example
@Jackie ^^
k

Ken Krugler

01/08/2021, 1:33 AM
Thanks for the hint, found an example in the code. Should be
select VALUEIN(mvfield, 'a', 'b') as groups from table group by groups
👍 1
m

Mayank

01/08/2021, 1:33 AM
Yeah, there you go
k

Ken Krugler

01/08/2021, 1:34 AM
Where should I add documentation for this UDF?
Perhaps suggest where you would have looked.
k

Ken Krugler

01/08/2021, 1:36 AM
OK - I was looking in documentation about grouping. So maybe a note there about when grouping on a multi-valued field that’s also been used for filtering?
m

Mayank

01/08/2021, 1:36 AM
yeah, makes sense