blob: 337ecede9ba2e0fb8febe16be07335d62b0671b1 [file] [log] [blame]
/*
* Description : Tests whether an ngram_index is applied to optimize a selection query using the edit-distance-check function on lists.
* Tests that the optimizer rule correctly drills through the let clauses.
* The index should *not* be applied (see below).
* Success : Yes
*/
drop dataverse test if exists;
create dataverse test;
use dataverse test;
create type AddressType as closed {
number: int32,
street: string,
city: string
}
create type CustomerType as closed {
cid: int32,
name: string,
age: int32?,
address: AddressType?,
interests: [string],
children: [ { name: string, age: int32? } ]
}
create dataset Customers(CustomerType) partitioned by key cid;
create index interests_index on Customers(interests) type keyword;
write output to nc1:"rttest/inverted-index-complex_olist-edit-distance-check-let-panic.adm";
for $c in dataset('Customers')
let $ed := edit-distance-check($c.interests, ["computers", "wine", "walking"], 3)
where $ed[0]
order by $c.cid
return $c