| drop dataverse test if exists; |
| |
| create dataverse test; |
| |
| use dataverse test; |
| |
| create type OrderType as open { |
| oid: int32, |
| cid: int32, |
| orderstatus: string, |
| orderpriority: string, |
| clerk: string, |
| total: float, |
| items: [int32] |
| } |
| |
| |
| create external dataset Orders(OrderType) |
| using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter" |
| (("path"="nc1://data/nontagged/orderData.json"),("format"="adm")); |
| |
| write output to nc1:"rttest/custord_order_q_02.adm"; |
| |
| for $o in dataset('Orders') |
| let $c1 := [ $o.orderstatus, $o.clerk] |
| let $c2 := {{ $o.orderstatus, $o.clerk}} |
| let $c3 := [$o.heList, $o.openlist, $o.loc, $o.line, $o.poly, $o.lastorder] |
| let $c4 := [$o.heList, $o.openlist, $o.loc, $o.line, $o.poly, $o.lastorder] |
| return { "id": $o.cid, "list1":$c1, "list2":$c2,"list3":$c3,"list4":$c4} |