added takeOrdered to pyspark