HIVE-12552 : Wrong number of reducer estimation causing job to fail (Rajesh Balamohan via Gunther Hagleitner)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b75d9ea8 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b75d9ea8 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b75d9ea8 Branch: refs/heads/llap Commit: b75d9ea8a73f85d1420f8e3ba1e3b8f9b9acdc5e Parents: b1c4502 Author: Rajesh Balamohan <rbalamohan at apache dot org> Authored: Wed Dec 9 11:48:00 2015 -0800 Committer: Ashutosh Chauhan <hashut...@apache.org> Committed: Fri Mar 25 07:21:55 2016 -0700 ---------------------------------------------------------------------- ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/b75d9ea8/ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java index 8eab3af..d5a2eca 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/GenTezUtils.java @@ -119,7 +119,8 @@ public class GenTezUtils { // max we allow tez to pick int maxPartition = (int) (reduceSink.getConf().getNumReducers() * maxPartitionFactor); - maxPartition = (maxPartition > maxReducers) ? maxReducers : maxPartition; + maxPartition = Math.max(1, (maxPartition > maxReducers) ? maxReducers : + maxPartition); reduceWork.setMinReduceTasks(minPartition); reduceWork.setMaxReduceTasks(maxPartition);