Github user viirya commented on the pull request:
https://github.com/apache/spark/pull/5811#issuecomment-98651019
Setting `mapred.reduce.tasks` to '-1' has special meaning that asks Hive to
automatically determine the number of reducers. It is the default value in
[hive-default.xml](https://issues.apache.org/jira/browse/HIVE-490). You can
also refer to
[`HADOOPNUMREDUCERS`](https://github.com/apache/hive/blob/c72d073c1fe2a07c80120647bb2170fb7e50d168/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java#L378).
Since it will parse the given string value, the configuration value of
"-01" or "-2" should be able to be parsed to integer value too. As I can tell
from the Hive sources, it checks if `mapred.reduce.tasks` is greater than 0
before using it in
[SemanticAnalyzer](https://github.com/apache/hive/blob/aaa112dbfd0b52285925dad4160f34487b8dfd82/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java#L6077)
and
[SetReducerParallelism](https://github.com/apache/hive/blob/aaa112dbfd0b52285925dad4160f34487b8dfd82/ql/src/java/org/apache/hadoop/hive/ql/optimizer/SetReducerParallelism.java#L66).
So I think these values "-01", "-2" would have the same effect as setting it
as '-1'.
Although I don't think it will be possible to have such values as setting
values for `mapred.reduce.tasks`, it is still good to consider these cases. I
will update it later.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]