vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | use dataverse events; |
| 2 | |
| 3 | declare type UserType as open { |
| 4 | name: string, |
| 5 | email: string, |
| 6 | interests: {{string}}, |
| 7 | address: AddressType, |
| 8 | member_of: {{ |
| 9 | { |
| 10 | sig_name: string, |
| 11 | chapter_name: string, |
| 12 | member_since: date |
| 13 | } |
| 14 | }} |
| 15 | } |
| 16 | |
| 17 | declare type AddressType as closed { |
| 18 | street: string, |
| 19 | city: string, |
| 20 | zip: string, |
| 21 | latlong: point |
| 22 | } |
| 23 | |
| 24 | declare nodegroup group1 on nc1, nc2; |
| 25 | |
| 26 | declare dataset User(UserType) partitioned by key name on group1; |
| 27 | |
| 28 | write output to nc1:"/tmp/q1.adm"; |
| 29 | |
| 30 | for $user in dataset('User') |
| 31 | where some $i in $user.interests |
| 32 | satisfies $i = "movies" |
| 33 | return {"name": $user.name} |