Fix #SPARK-1149 Bad partitioners can cause Spark to hang