Use Spark to generate nodeMap