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 | |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 15 | create dataset DBLPadm(DBLPType) |
ramangrover29 | 669d8f6 | 2013-02-11 06:03:32 +0000 | [diff] [blame^] | 16 | primary key id; |
vinayakb | 38b7ca4 | 2012-03-05 05:44:15 +0000 | [diff] [blame] | 17 | |
| 18 | // drop dataset DBLPadm; |
| 19 | load dataset DBLPadm |
| 20 | using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| 21 | (("path"="nc1://data/dblp-small/dblp-small.adm"),("format"="adm")); |
| 22 | |
| 23 | write output to nc1:"rttest/scan_20.adm"; |
| 24 | |
| 25 | for $paper in dataset('DBLPadm') |
| 26 | order by $paper.id |
| 27 | return $paper |