Is there a recommended way to do the following type of transform:
Input:
userID timestamp action
u1 100 edit1
u1 122 edit2
u1 135 edit3
u2 143 edit4
u2 158 edit5
u1 212 edit6
u1 241 edit7
Output:
userID startTime endTime actions
u1 100 135 [edit1, edit2, edit3]
u2 143 158 [edit4, edit5]
u1 212 241 [edit6, edit7]
Grouping by userID results in the session information being lost. Same with using Window functions.
EDIT for clarity: In this case, note that user u1 appears 2 times in the result set. The user u2's actions break up u1's actions into two sessions.