blob: e38178e3ecf830550abd89678b67dcfafd9941b2 [file] [log] [blame]
drop dataverse fuzzyjoin if exists;
create dataverse fuzzyjoin;
use dataverse fuzzyjoin;
create type UserType as open {
uid: int32,
name: string,
lottery_numbers: [int32],
interests: <string>
}
create type VisitorType as open {
vid: int32,
name: string,
lottery_numbers: [int32],
interests: <string>
}
create dataset Users(UserType) partitioned by key uid;
create dataset Visitors(VisitorType) partitioned by key vid;
load dataset Users from nc1:'data/users-visitors-small/users.json';
load dataset Visitors from nc1:'data/users-visitors-small/visitors.json';
write output to nc1:'rttest/fuzzyjoin_user-vis-lot-int-aqlplus_2.adm';
set simthreshold '.5f';
for $visitor in dataset('Visitors')
for $user in dataset('Users')
where $user.lottery_numbers ~= $visitor.lottery_numbers
and $user.interests ~= $visitor.interests
order by $user.uid, $visitor.vid
return { 'user': $user, 'visitor': $visitor }