Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add logic to read partition number from spark context local property.
  • Loading branch information
Yewei Zhang authored and markhamstra committed Nov 4, 2015
commit 648a0d53eaa41a70f867ec83b53505ae3911d997
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,16 @@ object Exchange {
* input partition ordering requirements are met.
*/
private[sql] case class EnsureRequirements(sqlContext: SQLContext) extends Rule[SparkPlan] {
private def defaultNumPreShufflePartitions: Int = sqlContext.conf.numShufflePartitions
private def defaultNumPreShufflePartitions: Int =
Option(sqlContext.sparkContext.getLocalProperty("spark.sql.shuffle.partitions")).map { str =>
try {
str.toInt
} catch {
case _: NumberFormatException =>
logError(s"Shuffle partition should be number, actual value $str")
sqlContext.conf.numShufflePartitions
}
}.getOrElse(sqlContext.conf.numShufflePartitions)

private def targetPostShuffleInputSize: Long = sqlContext.conf.targetPostShuffleInputSize

Expand Down