public int getNumPartitions() {
    return hashPartitions.length;
  }
Calculate how many partitions are needed.
For n-way join, we only do this calculation once in the HashTableLoader, for the biggest small
table. Other small tables will use the same number. They may need to adjust (usually reduce)
their individual write buffer size in order not to exceed memory threshold.
@param memoryThreshold memory threshold for the given table
@param dataSize total data size for the table
@param minNumParts minimum required number of partitions
@param minWbSize minimum required write buffer size
@return number of partitions needed
ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HybridHashTableContainer.java