blob: 2d2f34f81bab4ae4e8b0bac43cc9294d5a0f96c1 [file] [log] [blame]
alexander.behmc576c602012-07-06 02:41:15 +00001/*
2 * Description : Tests whether an ngram_index is applied to optimize a selection query using the edit-distance-check function on strings.
3 * Tests that the optimizer rule correctly drills through the let clauses.
4 * The index should be applied.
5 * Success : Yes
6 */
7
8drop dataverse test if exists;
9create dataverse test;
10use dataverse test;
11
12create type DBLPType as closed {
13 id: int32,
14 dblpid: string,
15 title: string,
16 authors: string,
17 misc: string
18}
19
ramangrover29669d8f62013-02-11 06:03:32 +000020create dataset DBLP(DBLPType) primary key id;
alexander.behmc576c602012-07-06 02:41:15 +000021
alexander.behmc576c602012-07-06 02:41:15 +000022create index ngram_index on DBLP(authors) type ngram(3);
23
24write output to nc1:"rttest/inverted-index-complex_ngram-edit-distance-check-let.adm";
25
26for $o in dataset('DBLP')
27let $ed := edit-distance-check($o.authors, "Amihay Motro", 1)
28where $ed[0]
29return $o