reformat the span function in RDD