blob: 9551294926a53826b1c23c7ec2b00e02f0940427 [file] [log] [blame]
/*
* Description : Tests whether a keyword index is applied to optimize a selection query using the similarity-jaccard-check function on sets.
* The index should be applied.
* 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-basic_ulist-jaccard.adm";
for $c in dataset('Customers')
where similarity-jaccard-check($c.interests, ["databases", "computers", "wine"], 0.7f)[0]
return $c