Skip to content

Commit 653858a

Browse files
show value spark.sql.shuffle.partitions for mapred.reduce.tasks
1 parent 1bed0a3 commit 653858a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

sql/core/src/main/scala/org/apache/spark/sql/execution/commands.scala

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ case class SetCommand(
6060
logWarning(s"Property ${SQLConf.Deprecated.MAPRED_REDUCE_TASKS} is deprecated, " +
6161
s"automatically converted to ${SQLConf.SHUFFLE_PARTITIONS} instead.")
6262
context.setConf(SQLConf.SHUFFLE_PARTITIONS, v)
63-
Array(Row(s"${SQLConf.SHUFFLE_PARTITIONS}=$v"))
63+
Seq(Row(s"${SQLConf.SHUFFLE_PARTITIONS}=$v"))
6464
} else {
6565
context.setConf(k, v)
66-
Array(Row(s"$k=$v"))
66+
Seq(Row(s"$k=$v"))
6767
}
6868

6969
// Query the value bound to key k.
@@ -78,11 +78,19 @@ case class SetCommand(
7878
"hive-hwi-0.12.0.jar",
7979
"hive-0.12.0.jar").mkString(":")
8080

81-
Array(
81+
context.getAllConfs.map { case (k, v) =>
82+
Row(s"$k=$v")
83+
}.toSeq ++ Seq(
8284
Row("system:java.class.path=" + hiveJars),
8385
Row("system:sun.java.command=shark.SharkServer2"))
8486
} else {
85-
Array(Row(s"$k=${context.getConf(k, "<undefined>")}"))
87+
if (k == SQLConf.Deprecated.MAPRED_REDUCE_TASKS) {
88+
logWarning(s"Property ${SQLConf.Deprecated.MAPRED_REDUCE_TASKS} is deprecated, " +
89+
s"showing ${SQLConf.SHUFFLE_PARTITIONS} instead.")
90+
Seq(Row(s"${SQLConf.SHUFFLE_PARTITIONS}=${context.numShufflePartitions}"))
91+
} else {
92+
Seq(Row(s"$k=${context.getConf(k, "<undefined>")}"))
93+
}
8694
}
8795

8896
// Query all key-value pairs that are set in the SQLConf of the context.

0 commit comments

Comments
 (0)