buyingyi | bd90411 | 2014-10-27 18:41:43 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Description : This test case is to verify the fix for issue550 |
| 3 | * https://code.google.com/p/asterixdb/issues/detail?id=550 |
| 4 | * Expected Result : Success |
| 5 | * Date : 25th October 2014 |
| 6 | */ |
| 7 | |
| 8 | let $sample := |
| 9 | {{ |
| 10 | {"r": 1, "uid": "1a2b", "t": datetime("2000-01-01T01:00:00"), "event": "e1"}, |
| 11 | {"r": 2, "uid": "1a2b", "t": datetime("2000-01-01T01:01:00"), "event": "e2"}, |
| 12 | {"r": 3, "uid": "3c4d", "t": datetime("2000-01-01T01:02:00"), "event": "e1"}, |
| 13 | {"r": 4, "uid": "3c4d", "t": datetime("2000-01-01T01:03:00"), "event": "e3"}, |
| 14 | {"r": 5, "uid": "1a2b", "t": datetime("2000-01-01T01:04:00"), "event": "e1"}, |
| 15 | {"r": 6, "uid": "1a2b", "t": datetime("2000-01-01T01:05:00"), "event": "e4"} |
| 16 | }} |
| 17 | for $s in $sample |
| 18 | group by $u := $s.uid with $s |
| 19 | return { |
| 20 | "u": $u, |
| 21 | "recs": ( for $srec in $s return $srec ) |
| 22 | }; |