vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | use dataverse demo_aql; |
| 2 | |
| 3 | declare type CustomerType as open { |
| 4 | cid: int32, |
| 5 | name: string, |
| 6 | age: int32?, |
| 7 | address: AddressType?, |
| 8 | interests: {{string}}, |
| 9 | children: [ { name: string, age: int32? } ] |
| 10 | } |
| 11 | |
| 12 | declare type AddressType as open { |
| 13 | number: int32, |
| 14 | street: string, |
| 15 | city: string |
| 16 | } |
| 17 | |
| 18 | declare nodegroup group1 on nc1, nc2; |
| 19 | |
| 20 | declare dataset Customers(CustomerType) |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame] | 21 | primary key cid on group1; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 22 | |
| 23 | write output to nc1:"/tmp/03-count-cust-age.adm"; |
| 24 | |
| 25 | count( |
| 26 | for $c in dataset('Customers') |
| 27 | where not(is-null($c.age)) |
| 28 | return $c |
| 29 | ) |