blob: 4bc6836292f0096c05e582749e26b837650277df [file] [log] [blame]
drop dataverse fuzzyjoin if exists;
create dataverse fuzzyjoin;
use dataverse fuzzyjoin;
create type DBLPType as open {
id: int32,
dblpid: string,
title: string,
authors: string,
misc: string
}
create dataset DBLP(DBLPType) partitioned by key id;
load dataset DBLP
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/pub-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")) pre-sorted;
write output to nc1:'rttest/fuzzyjoin_dblp-2_3.adm';
//
// -- - Stage 2 - --
//
for $paperDBLP in dataset('DBLP')
let $idDBLP := $paperDBLP.id
let $tokensDBLP :=
for $tokenUnranked in counthashed-word-tokens($paperDBLP.title)
for $tokenRanked at $i in
//
// -- - Stage 1 - --
//
for $paper in dataset('DBLP')
let $id := $paper.id
for $token in counthashed-word-tokens($paper.title)
group by $tokenGroupped := $token with $id
order by count($id), $tokenGroupped
return $tokenGroupped
where $tokenUnranked = $tokenRanked
order by $i
return $i
order by $idDBLP
return {'id': $idDBLP, 'tokens': $tokensDBLP}