Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/6456#discussion_r31373662
  
    --- Diff: 
core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala ---
    @@ -206,12 +215,8 @@ class AppendOnlyMap[K, V](initialCapacity: Int = 64)
     
       /** Double the table's size and re-hash everything */
       protected def growTable() {
    -    val newCapacity = capacity * 2
    -    if (newCapacity >= (1 << 30)) {
    -      // We can't make the table this big because we want an array of 2x
    -      // that size for our data, but array sizes are at most Int.MaxValue
    -      throw new Exception("Can't make capacity bigger than 2^29 elements")
    -    }
    +    // capacity < MAXIMUM_CAPACITY (2 ^ 29) so capacity * 2 won't overflow
    +    val newCapacity = (capacity * 2) min MAXIMUM_CAPACITY
    --- End diff --
    
    I think you mean `capacity * 2).min(MAXIMUM_CAPACITY)`, right? Updated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to