vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame^] | 1 | drop dataverse test if exists; |
| 2 | |
| 3 | create dataverse test; |
| 4 | use dataverse test; |
| 5 | |
| 6 | |
| 7 | create type AddressType as closed { |
| 8 | street: string, |
| 9 | city: string, |
| 10 | zip: string, |
| 11 | latlong: point |
| 12 | } |
| 13 | |
| 14 | create type UserType as open { |
| 15 | name: string, |
| 16 | email: string, |
| 17 | interests: {{string}}, |
| 18 | address: AddressType, |
| 19 | member_of: {{ |
| 20 | { |
| 21 | sig_id: int32, |
| 22 | chapter_name: string, |
| 23 | member_since: date |
| 24 | } |
| 25 | }} |
| 26 | } |
| 27 | |
| 28 | create nodegroup group1 if not exists on nc1, nc2; |
| 29 | |
| 30 | create external dataset User(UserType) |
| 31 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 32 | (("path"="nc1://data/events/tiny/user.adm"),("format"="adm")); |
| 33 | |
| 34 | write output to nc1:"rttest/dapd_q1.adm"; |
| 35 | |
| 36 | for $user in dataset('User') |
| 37 | where some $i in $user.interests |
| 38 | satisfies $i = "movies" |
| 39 | return {"name": $user.name} |