how to express array_agg(x order by t)?
jiamo opened this issue · comments
Jiamo commented
In such query
GroupEvents1(user_pseudo_id, events? List= custom_event_name) distinct :-
Events(user_pseudo_id:, custom_event_name:, event_timestamp:);
I want to get events with order by event_timestamp
still find no answer in document?
It will be the same situation in Functional aggregation:
GroupEvents2(user_pseudo_id) List= custom_event_name :-
Events(user_pseudo_id:, custom_event_name:, event_timestamp:);
Evgeny Skvortsov commented
This is done with Array
aggregate operator. I've updated tutorial to mention it.
In your Functional example it would be like so:
GroupEvents2(user_pseudo_id) Array= event_timestamp -> custom_event_name :-
Events(user_pseudo_id:, custom_event_name:, event_timestamp:);
Let me know if you have further questions.
Jiamo commented
Thanks.