vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame^] | 1 | /* scan and print an ADM file as a dataset of closed records */ |
| 2 | |
| 3 | drop dataverse test if exists; |
| 4 | create dataverse test; |
| 5 | use dataverse test; |
| 6 | |
| 7 | create type DBLPType as closed { |
| 8 | id: int32, |
| 9 | dblpid: string, |
| 10 | title: string, |
| 11 | authors: string, |
| 12 | misc: string |
| 13 | } |
| 14 | |
| 15 | create nodegroup group1 if not exists on nc1; |
| 16 | |
| 17 | create dataset DBLPadm(DBLPType) |
| 18 | partitioned by key id on group1; |
| 19 | |
| 20 | // drop dataset DBLPadm; |
| 21 | load dataset DBLPadm |
| 22 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 23 | (("path"="nc1://data/dblp-small/dblp-small.adm"),("format"="adm")); |
| 24 | |
| 25 | write output to nc1:"rttest/scan_20.adm"; |
| 26 | |
| 27 | for $paper in dataset('DBLPadm') |
| 28 | order by $paper.id |
| 29 | return $paper |