vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 1 | /* scan and print a delimited text file */ |
| 2 | drop dataverse test if exists; |
| 3 | create dataverse test; |
| 4 | use dataverse test; |
| 5 | |
| 6 | create type DBLPType as open { |
| 7 | id: int32, |
| 8 | dblpid: string, |
| 9 | title: string, |
| 10 | authors: string, |
| 11 | misc: string |
| 12 | } |
| 13 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 14 | create dataset DBLP1(DBLPType) |
khfaraaz82@gmail.com | 88f5c5d | 2012-05-02 20:04:10 +0000 | [diff] [blame] | 15 | partitioned by key id; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 16 | |
| 17 | // drop dataset DBLP1; |
| 18 | load dataset DBLP1 |
| 19 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 20 | (("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")); |
| 21 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 22 | write output to nc1:"rttest/scan_10.adm"; |
| 23 | |
| 24 | for $paper in dataset('DBLP1') |
| 25 | order by $paper.id |
| 26 | return $paper |