File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
main/scala/org/apache/spark/sql/execution
test/scala/org/apache/spark/sql Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -84,8 +84,8 @@ case class SetCommand(
8484 logWarning(
8585 s " Property ${SQLConf .Deprecated .MAPRED_REDUCE_TASKS } is deprecated, " +
8686 s " automatically converted to ${SQLConf .SHUFFLE_PARTITIONS } instead. " )
87- if (value == " -1 " ) {
88- val msg = s " Setting ${SQLConf .Deprecated .MAPRED_REDUCE_TASKS } to -1 for automatically " +
87+ if (value.toInt < 1 ) {
88+ val msg = s " Setting negative ${SQLConf .Deprecated .MAPRED_REDUCE_TASKS } for automatically " +
8989 " determining the number of reducers is not supported."
9090 throw new IllegalArgumentException (msg)
9191 } else {
Original file line number Diff line number Diff line change @@ -864,8 +864,11 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll {
864864
865865 test(" SET commands with illegal or inappropriate argument" ) {
866866 conf.clear()
867- // mapred.reduce.tasks=-1 for automatically determing the number of reducers is not supported
867+ // Set negative mapred.reduce.tasks for automatically determing
868+ // the number of reducers is not supported
868869 intercept[IllegalArgumentException ](sql(s " SET mapred.reduce.tasks=-1 " ))
870+ intercept[IllegalArgumentException ](sql(s " SET mapred.reduce.tasks=-01 " ))
871+ intercept[IllegalArgumentException ](sql(s " SET mapred.reduce.tasks=-2 " ))
869872 conf.clear()
870873 }
871874
You can’t perform that action at this time.
0 commit comments