blob: 207b5c9cf8a4490d6b042f3acc4517841f180884 [file] [log] [blame]
/*
* Description : Joins two datasets on the intersection of their point attributes.
* The dataset 'MyData1' has an RTree index, and we expect the
* join to be transformed into an indexed nested-loop join.
* Success : Yes
*/
drop dataverse test if exists;
create dataverse test;
use dataverse test;
create type MyRecord as closed {
id: int32,
point: point,
kwds: string,
line1: line,
line2: line,
poly1: polygon,
poly2: polygon,
rec: rectangle
}
create dataset MyData1(MyRecord) partitioned by key id;
create dataset MyData2(MyRecord) partitioned by key id;
create index rtree_index on MyData1(point) type rtree;
write output to nc1:"rttest/index-join_rtree-spatial-intersect-point.adm";
for $a in dataset('MyData1')
for $b in dataset('MyData2')
where spatial-intersect($a.point, $b.point)
return {"a": $a, "b": $b}