Given a date, find all Messages created before that date.
Group them by a 3-level grouping:
1st: by year of creation
2nd: for each year, group into message types, i.e., Posts or Comments
3rd: for each year-type group, split into four groups based on length of their content:
0 <= length < 40 --> 'short'
40 <= length < 80 --> 'one liner'
80 <= length < 160 --> 'tweet'
160 <= length --> 'long'
For every 3-level group, return:
- year - 32-bit Integer *
- message type - String --> (post/comment)
- length category - String --> (short/one-liner/tweet/long)
- message count - 32-bit Integer --> total number of Messages (Posts/Comments) in that group
- average message length - 32-bit Integer --> average length of the Message content in that group
- sum message length - 32-bit Integer --> sum of all message content lengths
- per messages - 32-bit floating point --> number of messages in group as a percentage of all messages created before the given date