deniskuzZ commented on code in PR #6593:
URL: https://github.com/apache/hive/pull/6593#discussion_r3565878688
##########
ql/src/java/org/apache/hadoop/hive/ql/exec/persistence/HybridHashTableContainer.java:
##########
@@ -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) {
Review Comment:
1073741823 ?? that's an unrealistic number + error message looks unrelated
What's the value of `memoryThreshold` here?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]