private void computeMaxEntriesHashAggr() throws HiveException {
    float memoryPercentage = this.getConf().getGroupByMemoryUsage();
    if (isTez) {
      maxHashTblMemory = (long) (memoryPercentage * getConf().getMaxMemoryAvailable());
    } else {
      maxHashTblMemory = (long) (memoryPercentage * Runtime.getRuntime().maxMemory());
    }
    LOG.info("Max hash table memory: {} bytes", maxHashTblMemory);
    estimateRowSize();
  }
Estimate the number of entries in map-side hash table. The user can specify
the total amount of memory to be used by the map-side hash. By default, all
available memory is used. The size of each row is estimated, rather
crudely, and the number of entries are figure out based on that.

@return number of entries that can fit in hash table - useful for map-side
        aggregation only
ql/src/java/org/apache/hadoop/hive/ql/exec/GroupByOperator.java