File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
main/scala/org/apache/spark/sql/execution
test/scala/org/apache/spark/sql Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,9 @@ case class SetCommand(
8585 s " Property ${SQLConf .Deprecated .MAPRED_REDUCE_TASKS } is deprecated, " +
8686 s " automatically converted to ${SQLConf .SHUFFLE_PARTITIONS } instead. " )
8787 if (value == " -1" ) {
88- logWarning(
89- s " Set this property to -1 for automatically determining the number of reducers " +
90- s " is not supported, showing current ${SQLConf .SHUFFLE_PARTITIONS } instead. " )
91- Seq (Row (s " ${SQLConf .SHUFFLE_PARTITIONS }= ${sqlContext.conf.numShufflePartitions}" ))
88+ val msg = s " Setting ${SQLConf .Deprecated .MAPRED_REDUCE_TASKS } to -1 for automatically " +
89+ " determining the number of reducers is not supported."
90+ throw new IllegalArgumentException (msg)
9291 } else {
9392 sqlContext.setConf(SQLConf .SHUFFLE_PARTITIONS , value)
9493 Seq (Row (s " ${SQLConf .SHUFFLE_PARTITIONS }= $value" ))
Original file line number Diff line number Diff line change @@ -830,6 +830,13 @@ class SQLQuerySuite extends QueryTest with BeforeAndAfterAll {
830830 conf.clear()
831831 }
832832
833+ test(" SET commands with illegal or inappropriate argument" ) {
834+ conf.clear()
835+ // mapred.reduce.tasks=-1 for automatically determing the number of reducers is not supported
836+ intercept[IllegalArgumentException ](sql(s " SET mapred.reduce.tasks=-1 " ))
837+ conf.clear()
838+ }
839+
833840 test(" apply schema" ) {
834841 val schema1 = StructType (
835842 StructField (" f1" , IntegerType , false ) ::
You can’t perform that action at this time.
0 commit comments