Hey, do we have any example querying/working on th...
# general
n
Hey, do we have any example querying/working on the multi-value column? I cannot find one in the document. e.g. get the first element in the multi-val column.
m
How do you want to use it? Note that it not necessarily be ordered.
n
I see. I have a column with a list of addresses of the customer, where each one is a json.
m
@User do we preserve MV column order? Rather should client rely on ordering?
j
We do preserver the order in MV column
Currently we don't have a function to pick the first element within a MV column, but it should be easy to add or plug in
n
The ordering is not important. I want to know how to fetch the first or the second element in the MV column. Do we have a pinot function to do that?
j
In
ArrayFunctions
we have several functions that applies to array. You may plug-in your own function with
ScalarFunction
annotation
n
Thanks, I will check that out. One more question, do you happen to know the behavior of trino/prestodb when it query a MV column? Any function I should applied on the result to be recognized as a array in trino?
j
@User ^^
n
You could use a groovy function to fetch a particular element from the array
m
I think the ask is for fetching it during query time.
n
we have groovy for query time too
👍 2
x
Prestodb should treat mv column as an array
n
several examples of getting elements from MV columns using groovy: https://docs.pinot.apache.org/users/user-guide-query/scalar-functions
m
Thanks @User