belugabehr commented on a change in pull request #1933: URL: https://github.com/apache/hive/pull/1933#discussion_r569580552
########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/MemoryInfo.java ########## @@ -34,9 +37,8 @@ private Configuration conf; private boolean isTez; private boolean isLlap; - private long maxExecutorMemory; - private long mapJoinMemoryThreshold; - private long dynPartJoinMemoryThreshold; + private long maxExecutorMemory; // value in Bytes Review comment: Sorry to nit, but can we make these 'final' instance variables? Also, can you please move the 'value in bytes' into a proper Javadoc on the getter method? ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java ########## @@ -700,13 +700,26 @@ public int getPartition(Object key, Object value, int numPartitions) { * container size isn't set. */ public static Resource getContainerResource(Configuration conf) { - int memory = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) > 0 ? - HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) : - conf.getInt(MRJobConfig.MAP_MEMORY_MB, MRJobConfig.DEFAULT_MAP_MEMORY_MB); - int cpus = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) > 0 ? - HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) : - conf.getInt(MRJobConfig.MAP_CPU_VCORES, MRJobConfig.DEFAULT_MAP_CPU_VCORES); - return Resource.newInstance(memory, cpus); + int memorySizeMb = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE); + if (memorySizeMb <= 0) { + LOG.warn("Falling back to MapReduce container MB {}", MRJobConfig.MAP_MEMORY_MB); + memorySizeMb = conf.getInt(MRJobConfig.MAP_MEMORY_MB, MRJobConfig.DEFAULT_MAP_MEMORY_MB); + // When config is explicitly set to "-1" defaultValue does not work! + if (memorySizeMb <= 0) { + LOG.warn("Falling back to default container MB {}", MRJobConfig.DEFAULT_MAP_MEMORY_MB); + memorySizeMb = MRJobConfig.DEFAULT_MAP_MEMORY_MB; + } + } + int cpuCores = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES); + if (cpuCores <= 0) { + LOG.warn("Falling back to MapReduce container VCores {}", MRJobConfig.MAP_CPU_VCORES); Review comment: Can we please update to say: ```java LOG.warn("No Tez VCore size specified by {}. Falling back...", HiveConf.ConfVars.HIVETEZCPUVCORES, MRJobConfig.MAP_CPU_VCORES); ``` ########## File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java ########## @@ -700,13 +700,26 @@ public int getPartition(Object key, Object value, int numPartitions) { * container size isn't set. */ public static Resource getContainerResource(Configuration conf) { - int memory = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) > 0 ? - HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE) : - conf.getInt(MRJobConfig.MAP_MEMORY_MB, MRJobConfig.DEFAULT_MAP_MEMORY_MB); - int cpus = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) > 0 ? - HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCPUVCORES) : - conf.getInt(MRJobConfig.MAP_CPU_VCORES, MRJobConfig.DEFAULT_MAP_CPU_VCORES); - return Resource.newInstance(memory, cpus); + int memorySizeMb = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE); + if (memorySizeMb <= 0) { + LOG.warn("Falling back to MapReduce container MB {}", MRJobConfig.MAP_MEMORY_MB); Review comment: Can we please update to say: ```java LOG.warn("No Tez container size specified by {}. Falling back...", HiveConf.ConfVars.HIVETEZCONTAINERSIZE, MRJobConfig.MAP_MEMORY_MB); ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org