vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | use dataverse fuzzy1; |
| 2 | |
| 3 | declare type UserType as open { |
| 4 | uid: {{int32}}, |
| 5 | name: string, |
| 6 | lottery_numbers: {{int32}}, |
| 7 | interests: {{string}} |
| 8 | } |
| 9 | |
| 10 | declare type VisitorType as open { |
| 11 | vid: {{int32}}, |
| 12 | name: string, |
| 13 | lottery_numbers: {{int32}}, |
| 14 | interests: {{string}} |
| 15 | } |
| 16 | |
| 17 | declare nodegroup group1 on nc1, nc2; |
| 18 | |
| 19 | declare dataset Users(UserType) |
| 20 | partitioned by key uid on group1; |
| 21 | declare dataset Visitors(VisitorType) |
| 22 | partitioned by key vid on group1; |
| 23 | |
| 24 | write output to nc1:'/tmp/users-visitors.adm'; |
| 25 | |
| 26 | set simthreshold '.5'; |
| 27 | |
| 28 | for $user in dataset('Users') |
| 29 | for $visitor in dataset('Visitors') |
| 30 | where $user.interests ~= $visitor.interests |
| 31 | return { 'user': $user, 'visitor': $visitor } |