blob: ef38109d7297a9f2d04fc0a5d6001a1031f898e0 [file] [log] [blame]
drop dataverse test if exists;
create dataverse test;
use dataverse test;
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;
create dataset tenktup1(Schema) partitioned by key unique2;
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;
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-into-loaded-dataset_02.adm";
for $t in dataset('tmp')
order by $t.unique2
return $t