blob: f88b89706162bf89a8d80103ab68b8c7fd7531cf [file] [log] [blame]
alexander.behm048a2a32012-05-03 06:18:56 +00001/*
2 * Test case Name : insert-into-empty-dataset-with-index.aql
3 * Description : Check that we can insert into an empty dataset and its empty secondary indexes
4 * Expected Result : Success
5 * Date : May 2 2012
6 */
7
8drop dataverse test if exists;
9create dataverse test;
10use dataverse test;
11
12create type LineIDType as closed {
13 l_orderkey: int32,
14 l_linenumber: int32,
15 l_suppkey: int32
16}
17
18create dataset LineID(LineIDType)
19 partitioned by key l_orderkey, l_linenumber;
20
21create index idx_LineID_partkey on LineID(l_linenumber);
22create index idx_LineID_suppkey on LineID(l_suppkey);
23
24insert into dataset LineID (
25let $x:=1
26let $y:=2
27let $z:=3
28return {
29 "l_orderkey": $x,
30 "l_partkey": $y,
31 "l_suppkey": $z
32}
33);
34
35insert into dataset LineID (
36let $x:=2
37let $y:=3
38let $z:=4
39return {
40 "l_orderkey": $x,
41 "l_partkey": $y,
42 "l_suppkey": $z
43}
44);
45
46write output to nc1:"rttest/dml_insert-into-empty-dataset-with-index.adm";
47for $c in dataset('LineID')
48where $c.l_suppkey < 100 and $c.l_linenumber<5
49order by $c.l_orderkey, $c.l_linenumber
50return $c