| * Description : Equi joins two datasets, Customers and Orders, based on the customer id. |
| * Given the 'indexnl' hint we expect the join to be transformed |
| * into an indexed nested-loop join using Customers' primary index. |
| drop dataverse test if exists; |
| create type AddressType as open { |
| create type CustomerType as closed { |
| create type OrderType as open { |
| create dataset Customers(CustomerType) primary key cid; |
| create dataset Orders(OrderType) primary key oid; |
| using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| (("path"="nc1://data/nontagged/customerData.json"),("format"="adm")); |
| using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| (("path"="nc1://data/nontagged/orderData.json"),("format"="adm")); |
| write output to nc1:"rttest/index-join_btree-primary-equi-join.adm"; |
| for $c in dataset('Customers') |
| for $o in dataset('Orders') |
| where $c.cid /*+ indexnl */ = $o.cid |
| return {"cid":$c.cid, "oid": $o.oid} |