Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -701,12 +701,17 @@ public static int calcNumPartitions(long memoryThreshold, long dataSize, int min
int minWbSize) throws IOException {
int numPartitions = minNumParts;

if (memoryThreshold < minNumParts * minWbSize) {
if (memoryThreshold < (long) minNumParts * minWbSize) {
LOG.warn("Available memory is not enough to create a HybridHashTableContainer!");
}

if (memoryThreshold / 2 < dataSize) { // The divided-by-2 logic is consistent to MapJoinOperator.reloadHashTable
while (dataSize / numPartitions > memoryThreshold / 2) {
// Prevent integer overflow
if (numPartitions > Integer.MAX_VALUE / 2) {
throw new IOException("Cannot create a Hybrid Grace Hash Join with a table size this large ("
+ dataSize + " bytes) against a memory threshold of " + memoryThreshold + " bytes");
}
numPartitions *= 2;
}
}
Expand Down
Loading