Skip to content

Commit

Permalink
fix sort eval bug
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-wang committed Apr 3, 2015
1 parent 303b6da commit 57baa40
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ case class Exchange(newPartitioning: Partitioning, child: SparkPlan) extends Una
iter.map(r => mutablePair.update(hashExpressions(r), r))
}
}
val sortingExpressions = expressions.map(s => new SortOrder(s, Ascending))
val sortingExpressions = expressions.zipWithIndex.map {
case (exp, index) =>
new SortOrder(BoundReference(index, exp.dataType, exp.nullable), Ascending)
}
val ordering = new RowOrdering(sortingExpressions, child.output)
val part = new HashPartitioner(numPartitions)
val shuffled = new ShuffledRDD[Row, Row, Row](rdd, part).setKeyOrdering(ordering)
Expand Down

0 comments on commit 57baa40

Please sign in to comment.