Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-wang committed Apr 12, 2015
1 parent 078d69b commit 00a4430
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,14 @@ private[sql] case class AddExchange(sqlContext: SQLContext) extends Rule[SparkPl
def addExchangeIfNecessary(
partitioning: Partitioning,
child: SparkPlan,
rowOrdering: Option[Ordering[Row]] = None): SparkPlan =
if (child.outputPartitioning != partitioning) {
Exchange(partitioning, child, sort = child.outputOrdering != rowOrdering)
rowOrdering: Option[Ordering[Row]] = None): SparkPlan = {
val needSort = child.outputOrdering != rowOrdering
if (child.outputPartitioning != partitioning || needSort) {
Exchange(partitioning, child, sort = needSort)
} else {
child
}
}

if (meetsRequirements && compatible) {
operator
Expand Down

0 comments on commit 00a4430

Please sign in to comment.