Amortize traversing array by doing it once per RDD.