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