belugabehr commented on a change in pull request #1933: URL: https://github.com/apache/hive/pull/1933#discussion_r567967118
########## File path: ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java ########## @@ -1915,15 +1915,26 @@ private static String getFullyQualifiedName(String... names) { return result; } - public static long getAvailableMemory(Configuration conf) { - int memory = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE); - if (memory <= 0) { - memory = conf.getInt(MRJobConfig.MAP_MEMORY_MB, MRJobConfig.DEFAULT_MAP_MEMORY_MB); - if (memory <= 0) { - memory = 1024; + /** + * Get the Container Memory Size from given conf (in MB). + * Returns HIVETEZCONTAINERSIZE when set, otherwise falls back to MAP_MEMORY_MB. + * When MAP_MEMORY_MB is explicitly set to "-1" uses DEFAULT_MAP_MEMORY_MB (1024) to avoid failures. + * @param conf Configuration + * @param isTez true if in Tez mode + * @return Container Memory Size in MB + */ + public static int getAvailableMemory(Configuration conf, boolean isTez) { + int containerMemSizeMb = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVETEZCONTAINERSIZE); Review comment: Not sure why `isTez` was added here,... why return anything if it's not Tez as this method is strictly for determining Tez container size. ---------------------------------------------------------------- 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