blob: 4e9e59435e9d43fe9e2c4ceed0d27af08bacb3a7 [file] [log] [blame]
drop dataverse test if exists;
create dataverse test;
use dataverse test;
create nodegroup group1 if not exists on nc1, nc2;
create type Schema as closed {
unique1: int32,
unique2: int32,
two: int32,
four: int32,
ten: int32,
twenty: int32,
onePercent: int32,
tenPercent: int32,
twentyPercent: int32,
fiftyPercent: int32,
unique3: int32,
evenOnePercent: int32,
oddOnePercent: int32,
stringu1: string,
stringu2: string,
string4: string
}
create dataset onektup(Schema) partitioned by key unique2 on group1;
create dataset tenktup1(Schema) partitioned by key unique2 on group1;
load dataset onektup
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/wisc/onektup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
load dataset tenktup1
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/wisc/tenktup.adm"),("format"="delimited-text"),("delimiter"="|")) pre-sorted;
create dataset tmp(Schema) partitioned by key unique2 on group1;
load dataset tmp
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/wisc/empty.adm"),("format"="adm")) pre-sorted;
insert into dataset tmp(
for $l in dataset('tenktup1')
where $l.unique2 > 0 and $l.unique2 < 99
return $l
);
write output to nc1:"rttest/dml_insert-wisc.adm";
for $t in dataset('tmp')
order by $t.unique2
return $t