blob: 3a3a303ae49919354c20ad8fd679597208d64407 [file] [log] [blame]
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 nodegroup group1 if not exists on nc1;
create dataset Customers(CustomerType)
partitioned by key cid on group1;
load dataset Customers
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/semistructured/co1k_olist/customer.adm"),("format"="adm"));
create index interests_index on Customers(interests) type fuzzy keyword;
write output to nc1:"rttest/index-selection_fuzzy-inverted-index-olist-edit-distance-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