Skip to content

Commit

Permalink
Show warning message if mapred.reduce.tasks is set to -1.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Apr 30, 2015
1 parent 7dacc08 commit 68a1c70
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,15 @@ case class SetCommand(
logWarning(
s"Property ${SQLConf.Deprecated.MAPRED_REDUCE_TASKS} is deprecated, " +
s"automatically converted to ${SQLConf.SHUFFLE_PARTITIONS} instead.")
sqlContext.setConf(SQLConf.SHUFFLE_PARTITIONS, value)
Seq(Row(s"${SQLConf.SHUFFLE_PARTITIONS}=$value"))
if (value == "-1") {
logWarning(
s"Set this property to -1 for automatically determining the number of reducers " +
s"is not supported, showing current ${SQLConf.SHUFFLE_PARTITIONS} instead.")
Seq(Row(s"${SQLConf.SHUFFLE_PARTITIONS}=${sqlContext.conf.numShufflePartitions}"))
} else {
sqlContext.setConf(SQLConf.SHUFFLE_PARTITIONS, value)
Seq(Row(s"${SQLConf.SHUFFLE_PARTITIONS}=$value"))
}

// Configures a single property.
case Some((key, Some(value))) =>
Expand Down

0 comments on commit 68a1c70

Please sign in to comment.