Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to express array_agg(x order by t)? #181

Closed
jiamo opened this issue Oct 25, 2021 · 2 comments
Closed

how to express array_agg(x order by t)? #181

jiamo opened this issue Oct 25, 2021 · 2 comments

Comments

@jiamo
Copy link

jiamo commented Oct 25, 2021

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:);
@EvgSkv
Copy link
Owner

EvgSkv commented Oct 25, 2021

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
Copy link
Author

jiamo commented Oct 26, 2021

Thanks.

@jiamo jiamo closed this as completed Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants