| drop dataverse test if exists; |
| create type AddressType as closed { |
| create type UserType as open{ |
| create dataset User(UserType) |
| using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| (("path"="nc1://data/events/tiny/user.adm"),("format"="json")) pre-sorted; |
| write output to nc1:'rttest/dapd_q3.adm'; |
| for $user in dataset('User') |
| for $similar_user in dataset('User') |
| where $user.name != $similar_user.name |
| and $user.interests ~= $similar_user.interests |
| let $sim := similarity-jaccard($user.interests, $similar_user.interests) |
| return { "user_name": $similar_user.name } |
| return { "user_name" : $user.name, "similar_users" : $similar_users } |