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