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 | |
| 14 | |
| 15 | create nodegroup group1 if not exists on nc1; |
| 16 | |
| 17 | create dataset DBLP1(DBLPType) |
| 18 | partitioned by key id on group1; |
| 19 | |
| 20 | // drop dataset DBLP1; |
| 21 | load dataset DBLP1 |
| 22 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 23 | (("path"="nc1://data/dblp-small/dblp-small-id.txt"),("format"="delimited-text"),("delimiter"=":")); |
| 24 | |
| 25 | |
| 26 | write output to nc1:"rttest/scan_10.adm"; |
| 27 | |
| 28 | for $paper in dataset('DBLP1') |
| 29 | order by $paper.id |
| 30 | return $paper |