blob: c02eba229b5d78b19593c9e8fdf374a2ddd4bc7c [file] [log] [blame]
drop dataverse test if exists;
create dataverse test;
use dataverse test;
create type MyRecord as open {
id: int32,
point: point,
kwds: string
}
create external dataset MyData(MyRecord)
using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
(("path"="nc1://data/spatial/spatialData.json"),("format"="adm"));
write output to nc1:"rttest/spatial_distance-between-points.adm";
for $o in dataset('MyData')
let $distance := spatial-distance($o.point, create-point(0.0, 0.0))
order by $o.id
return {"id":$o.id, "distance":$distance}