| /* |
| * Licensed to the Apache Software Foundation (ASF) under one |
| * or more contributor license agreements. See the NOTICE file |
| * distributed with this work for additional information |
| * regarding copyright ownership. The ASF licenses this file |
| * to you under the Apache License, Version 2.0 (the |
| * "License"); you may not use this file except in compliance |
| * with the License. You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, |
| * software distributed under the License is distributed on an |
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| * KIND, either express or implied. See the License for the |
| * specific language governing permissions and limitations |
| * under the License. |
| */ |
| /* |
| * Description : Notice the query hint to use an indexed nested-loops join plan. |
| * : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index. |
| * Expected Res : Success |
| * Date : 29th November 2012 |
| */ |
| |
| drop dataverse test1 if exists; |
| create dataverse test1; |
| |
| create type test1.TestType as |
| { |
| key1 : int32, |
| key2 : int32, |
| fname : string, |
| lname : string |
| } |
| |
| create dataset test1.DsOne(TestType) primary key key1; |
| |
| create dataset test1.DsTwo(TestType) primary key key1; |
| |
| write output to asterix_nc1:"rttest/btree-index-join_primary-equi-join_01.adm" |
| select element x |
| from `test1.DsOne` as x, |
| `test1.DsTwo` as y |
| where (x.key1 /*+ indexnl */ = y.key2) |
| ; |