Skip to content

Commit

Permalink
Disable unsafe Exchange path when RangePartitioning is used
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshRosen committed Jul 29, 2015
1 parent 715517b commit ea250da
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ case class Exchange(newPartitioning: Partitioning, child: SparkPlan) extends Una

override def canProcessSafeRows: Boolean = true

override def canProcessUnsafeRows: Boolean = true
override def canProcessUnsafeRows: Boolean = {
// Do not use the Unsafe path if we are using a RangePartitioning, since this may lead to
// an interpreted RowOrdering being applied to an UnsafeRow, which will lead to
// ClassCastExceptions at runtime. This check can be removed after SPARK-9054 is fixed.
!newPartitioning.isInstanceOf[RangePartitioning]
}

/**
* Determines whether records must be defensively copied before being sent to the shuffle.
Expand Down

0 comments on commit ea250da

Please sign in to comment.