I'm trying to read a file which has all the grocery stores into RDD. Goal is to find out the nearest 500 stores for a given grocery store and do some processing. 
For example if a store is taken, I'll have to find all the stores in that city. If I do map on the RDD, I get single store to the transform function. How do I get all the stores in that function. 

Snippet

```
def getNearestStores(store):
    stores_city = stores.filter("city="+store.city)
    return (store.id,stores_city.count()) 
stores = sc.textFile("stores.json").map(getNearestStores).count()

```

This is the simple code snippet. Stores.json is a huge file

1) How can I get the nearest 500 stores, presumably by using the stores.json, in the getNearestStores function?

2) What is the max broadcast variable size in PySpark?