diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/HiveSplitGenerator.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/HiveSplitGenerator.java index 8e48c2e..5aa6867 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/HiveSplitGenerator.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/HiveSplitGenerator.java @@ -135,7 +135,13 @@ public HiveSplitGenerator(InputInitializerContext initializerContext) throws IOE int totalResource = getContext().getTotalAvailableResource().getMemory(); int taskResource = getContext().getVertexTaskResource().getMemory(); - int availableSlots = totalResource / taskResource; + if (totalResource < 0) { + throw new RuntimeException("Bad value from scheduler: Total Available Memory: " + totalResource); + } + if (taskResource < 0) { + throw new RuntimeException("Bad value from scheduler: Vertex Task Memory: " + taskResource); + } + int availableSlots = totalResource / (taskResource == 0 ? 1 : taskResource); if (HiveConf.getLongVar(conf, HiveConf.ConfVars.MAPREDMINSPLITSIZE, 1) <= 1) { // broken configuration from mapred-default.xml