public long computeOnlineDataSizeGeneric(Statistics statistics, long overHeadPerRow, long overHeadPerSlot) {
    long onlineDataSize = 0;
    long numRows = statistics.getNumRows();
    if (numRows <= 0) {
      numRows = 1;
    }
    long worstCaseNeededSlots = 1L << DoubleMath.log2(numRows / hashTableLoadFactor, RoundingMode.UP);
    onlineDataSize += statistics.getDataSize() - hashTableDataSizeAdjustment(numRows, statistics.getColumnStats());
    onlineDataSize += overHeadPerRow * statistics.getNumRows();
    onlineDataSize += overHeadPerSlot * worstCaseNeededSlots;
    return onlineDataSize;
  }
ConvertJoinMapJoin is an optimization that replaces a common join
(aka shuffle join) with a map join (aka broadcast or fragment replicate
join when possible. Map joins have restrictions on which joins can be
converted (e.g.: full outer joins cannot be handled as map joins) as well
as memory restrictions (one side of the join has to fit into memory).
ql/src/java/org/apache/hadoop/hive/ql/optimizer/ConvertJoinMapJoin.java