blob: f9db086179b67b854e47ba6d735132ff912697f8 [file] [log] [blame]
alexander.behm048a2a32012-05-03 06:18:56 +00001/*
alexander.behma52976c2012-05-03 09:06:21 +00002 * Test case Name : empty-load-with-index.aql
3 * Description : Check that an empty load doesn't preclude a future non-empty load on primary index
alexander.behm048a2a32012-05-03 06:18:56 +00004 * Expected Result : Success
5 * Date : May 2 2012
6 */
7
8drop dataverse test if exists;
9create dataverse test;
10use dataverse test;
11
alexander.behma52976c2012-05-03 09:06:21 +000012create type LineItemType as closed {
alexander.behm048a2a32012-05-03 06:18:56 +000013 l_orderkey: int32,
alexander.behma52976c2012-05-03 09:06:21 +000014 l_partkey: int32,
15 l_suppkey: int32,
alexander.behm048a2a32012-05-03 06:18:56 +000016 l_linenumber: int32,
alexander.behma52976c2012-05-03 09:06:21 +000017 l_quantity: double,
18 l_extendedprice: double,
19 l_discount: double,
20 l_tax: double,
21 l_returnflag: string,
22 l_linestatus: string,
23 l_shipdate: string,
24 l_commitdate: string,
25 l_receiptdate: string,
26 l_shipinstruct: string,
27 l_shipmode: string,
28 l_comment: string
alexander.behm048a2a32012-05-03 06:18:56 +000029}
30
alexander.behma52976c2012-05-03 09:06:21 +000031create dataset LineItem(LineItemType)
alexander.behm048a2a32012-05-03 06:18:56 +000032 partitioned by key l_orderkey, l_linenumber;
33
alexander.behma52976c2012-05-03 09:06:21 +000034create index part_index on LineItem(l_partkey);
35
36load dataset LineItem
alexander.behm048a2a32012-05-03 06:18:56 +000037using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
38(("path"="nc1://data/empty.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
39
alexander.behma52976c2012-05-03 09:06:21 +000040load dataset LineItem
alexander.behm048a2a32012-05-03 06:18:56 +000041using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
42(("path"="nc1://data/tpch0.001/lineitem.tbl"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
43
44write output to nc1:"rttest/dml_empty-load.adm";
alexander.behma52976c2012-05-03 09:06:21 +000045for $c in dataset('LineItem')
alexander.behm048a2a32012-05-03 06:18:56 +000046order by $c.l_orderkey, $c.l_linenumber
47limit 1
alexander.behma52976c2012-05-03 09:06:21 +000048return $c