def prepare_rdd(self, object_rdd: SpatialRDD, window_rdd: SpatialRDD, grid_type: GridType): object_rdd.analyze() window_rdd.analyze() object_rdd.rawSpatialRDD.repartition(4) object_rdd.spatialPartitioning(grid_type) object_rdd.buildIndex(IndexType.RTREE, True) window_rdd.spatialPartitioning(object_rdd.getPartitioner())
def partition_rdds(self, query_rdd: SpatialRDD, spatial_rdd: SpatialRDD, grid_type, use_legacy_apis): spatial_rdd.spatialPartitioning(grid_type) if use_legacy_apis: if grid_type != GridType.QUADTREE: query_rdd.spatialPartitioning(spatial_rdd.grids) else: query_rdd.spatialPartitioning(spatial_rdd.partitionTree) else: query_rdd.spatialPartitioning(spatial_rdd.getPartitioner())