blob: 1b4b74a74acfc52596ace2390008ba1d54dd8659 [file] [log] [blame]
Young-Seokbe353dd2014-05-22 20:30:45 -07001/*
2 * Description : Tests whether an ngram_index is applied to optimize a join query using the contains function.
3 * The index should be applied.
4 * Success : Yes
5 */
6
7drop dataverse test if exists;
8create dataverse test;
9use dataverse test;
10
11create type DBLPType as closed {
12 id: int32,
13 dblpid: string,
14 title: string,
15 authors: string,
16 misc: string
17}
18
19create dataset DBLP(DBLPType) primary key id;
20
21create index ngram_index on DBLP(title) type ngram(3);
22
23write output to nc1:"rttest/inverted-index-join_ngram-contains.adm";
24
Young-Seokbe353dd2014-05-22 20:30:45 -070025for $o1 in dataset('DBLP')
26for $o2 in dataset('DBLP')
27where contains($o1.title, $o2.title) and $o1.id < $o2.id
28order by $o1.id, $o2.id
29return {"title1":$o1.title, "title2":$o2.title}