vineethvp opened a new issue, #13547:
URL: https://github.com/apache/pinot/issues/13547
I have a table in the below format where i want to combine all the values
into an array.
device_id affected_devices
CNQ5LBN2NL-test4
{"device_list":["CNQ5LBN2NL-test4-test"],"device_type":"client1"}
CNQ5LBN2NL-test6
{"device_list":["CNQ5LBN2NL-test6"],"device_type":"client2"}
CNQ5LBN2NL-test3
{"device_list":["CNQ5LBN2NL-test3-test"],"device_type":"client3"}
CNQ5LBN2NL-test5
{"device_list":["CNQ5LBN2NL-test5"],"device_type":"client4"}
CNQ5LBN2NL-test7
{"device_list":["CNQ5LBN2NL-test7"],"device_type":"client5"}
CNQ5LBN2NL-test1
{"device_list":["CNQ5LBN2NL-test1-test"],"device_type":"client6"}
CNQ5LBN2NL-test2
{"device_list":["CNQ5LBN2NL-test2-test"],"device_type":"client7"}
I'm looking for an o/p like
device_list
device_client_list
{CNQ5LBN2NL-test4,CNQ5LBN2NL-test3,CNQ5LBN2NL-test5}
{"client1","client3","client4"}
I want to maintain the same order while aggregating the array value so that
i can match them based on index later.
My query is like below
**select
array_agg(device_id,'STRING',null),array_agg(affected_devices,'STRING',null)
from table**
But it seems the ordering is not guaranteed after if i use array_agg. The
output i'm getting is like below
device_list
device_client_list
{CNQ5LBN2NL-test4,CNQ5LBN2NL-test3,CNQ5LBN2NL-test5}
{"client3","client1","client4"}
Is there way to use array aggregation on multiple column by preserving the
order?
--
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]