buyingyi | b1dd834 | 2014-11-26 14:37:12 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Description : This test case is to verify the fix for issue697 |
| 3 | * https://code.google.com/p/asterixdb/issues/detail?id=697 |
| 4 | * Expected Result : Success |
| 5 | * Date : 16th Nov. 2014 |
| 6 | */ |
| 7 | |
| 8 | drop dataverse test if exists; |
| 9 | create dataverse test; |
| 10 | |
| 11 | use dataverse test; |
| 12 | |
| 13 | create type TestType as closed { |
| 14 | key1: int32, |
| 15 | value: int32 |
| 16 | } |
| 17 | |
| 18 | create dataset test(TestType) |
| 19 | primary key key1; |
| 20 | |
| 21 | |
| 22 | for $i in dataset("test") |
| 23 | group by $aid := $i.key1 with $i |
| 24 | return { |
| 25 | "gid": $aid, |
| 26 | "avg": avg(for $j in $i where not(is-null($j.value)) return $j.value) |
| 27 | } |