blob: e1825d0d15dd1c3a14ace19b46913016e269facb [file] [log] [blame]
vinayakb38b7ca42012-03-05 05:44:15 +00001drop dataverse test if exists;
2
3create dataverse test;
4
5use dataverse test;
6
vinayakb38b7ca42012-03-05 05:44:15 +00007create type Schema as closed {
8unique1: int32,
9unique2: int32,
10two: int32,
11four: int32,
12ten: int32,
13twenty: int32,
14onePercent: int32,
15tenPercent: int32,
16twentyPercent: int32,
17fiftyPercent: int32,
18unique3: int32,
19evenOnePercent: int32,
20oddOnePercent: int32,
21stringu1: string,
22stringu2: string,
23string4: string
24}
25
khfaraaz82@gmail.com502731f2012-05-02 20:38:16 +000026create dataset onektup(Schema) partitioned by key unique2;
vinayakb38b7ca42012-03-05 05:44:15 +000027
khfaraaz82@gmail.com502731f2012-05-02 20:38:16 +000028create dataset tenktup1(Schema) partitioned by key unique2;
vinayakb38b7ca42012-03-05 05:44:15 +000029
30load dataset onektup
31using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
32(("path"="nc1://data/wisc/onektup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
33
34load dataset tenktup1
35using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
36(("path"="nc1://data/wisc/tenktup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
37
khfaraaz82@gmail.com502731f2012-05-02 20:38:16 +000038create dataset tmp(Schema) partitioned by key unique2;
vinayakb38b7ca42012-03-05 05:44:15 +000039
40load dataset tmp
41using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
42(("path"="nc1://data/wisc/empty.adm"),("format"="adm")) pre-sorted;
43
44insert into dataset tmp(
45for $l in dataset('tenktup1')
46where $l.unique2 > 0 and $l.unique2 < 99
47return $l
48);
49
50write output to nc1:"rttest/dml_insert-wisc.adm";
51for $t in dataset('tmp')
52order by $t.unique2
53return $t