generalized distance to neighbor driver in order to read/write data more generically.
updated spark version