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