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