Aggarwal-Raghav commented on code in PR #6593:
URL: https://github.com/apache/hive/pull/6593#discussion_r3565971953


##########
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:
   yes, the stacktrace was a symptom, Somewhere in planner it has gone wrong or 
maybe user overridding the configs in beeline session caused this flow.
   
   Closing this. If I find something new will re-open this.



-- 
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]

Reply via email to