blob: 00b60cb31d8441fd35c8e88a9683359e1c28d6cb [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,
alexander.behm8ebed0d2012-05-04 00:05:52 +000030 "l_linenumber": $y,
alexander.behm048a2a32012-05-03 06:18:56 +000031 "l_suppkey": $z
32}
33);
34
35insert into dataset LineID (
36let $x:=2
37let $y:=3
38let $z:=4
39return {
40 "l_orderkey": $x,
alexander.behm8ebed0d2012-05-04 00:05:52 +000041 "l_linenumber": $y,
alexander.behm048a2a32012-05-03 06:18:56 +000042 "l_suppkey": $z
43}
44);
45
alexander.behmb57d8332012-05-10 08:01:56 +000046write output to nc1:"rttest/dml_insert-into-empty-dataset-with-index.adm";
alexander.behm048a2a32012-05-03 06:18:56 +000047for $c in dataset('LineID')
alexander.behmb57d8332012-05-10 08:01:56 +000048where $c.l_suppkey < 100 and $c.l_linenumber<5
alexander.behm048a2a32012-05-03 06:18:56 +000049order by $c.l_orderkey, $c.l_linenumber
50return $c