blob: b676cd511aa091c797be5d18215957eb18d499ef [file] [log] [blame]
khfaraaz82@gmail.comca3d41f2013-02-04 22:10:44 +00001/*
2 * Description : Notice the query hint to use an indexed nested-loops join plan.
3 * : We expect a plan that hash-exchanges internal dataset DsTwo, then probes internal dataset DsOne’s primary index.
4 * Expected Res : Success
5 * Date : 29th November 2012
6 */
7
8drop dataverse test1 if exists;
9create dataverse test1;
10
11create type test1.TestType as open {
12 key1: int32,
13 key2: int32,
14 fname : string,
15 lname : string
16}
17
18create dataset test1.DsOne(TestType) partitioned by key key1;
19create dataset test1.DsTwo(TestType) partitioned by key key1;
20
21// Please note content enclosed in the comment in the predicate is the HINT to the optimizer
22
23for $x in dataset('test1.DsOne')
24for $y in dataset('test1.DsTwo')
25where $x.key1 /*+ indexnl */ > $y.key2
26return $x
27