Skip to content

Instantly share code, notes, and snippets.

@jiayuasu
Last active February 25, 2017 13:05
Show Gist options
  • Save jiayuasu/28cb8edb3287f705ed4d30c30de07639 to your computer and use it in GitHub Desktop.
Save jiayuasu/28cb8edb3287f705ed4d30c30de07639 to your computer and use it in GitHub Desktop.
1.Create a PointRDD objectRDD;
2.Create a RectangleRDD queryWindowRDD;
3.Collect rectangles from queryWindowRDD to one Java List L;
4. For each rectangle R in L
do RangeQuery.SpatialRangeQuery(objectRDD, queryEnvelope, 0);
End;
5.Collect all results; //"Collect" is a standard function under SparkContext.
6.Parallelize the results to generate a RDD in this format: JavaPairRDD<Envelope, HashSet<Point>>.;//"Parallelize" is a standard function under SparkContext.
7.Return the result RDD;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment