spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rxin <...@git.apache.org>
Subject [GitHub] spark pull request #15907: [SPARK-18458][CORE] Fix signed integer overflow p...
Date Fri, 18 Nov 2016 02:18:11 GMT
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15907#discussion_r88589145
  
    --- Diff: core/src/test/scala/org/apache/spark/util/collection/unsafe/sort/RadixSortSuite.scala
---
    @@ -73,22 +73,22 @@ class RadixSortSuite extends SparkFunSuite with Logging {
           },
           2, 4, false, false, true))
     
    -  private def generateTestData(size: Int, rand: => Long): (Array[JLong], LongArray)
= {
    -    val ref = Array.tabulate[Long](size) { i => rand }
    -    val extended = ref ++ Array.fill[Long](size)(0)
    +  private def generateTestData(size: Long, rand: => Long): (Array[JLong], LongArray)
= {
    +    val ref = Array.tabulate[Long](size.toInt) { i => rand }
    +    val extended = ref ++ Array.fill[Long](size.toInt)(0)
         (ref.map(i => new JLong(i)), new LongArray(MemoryBlock.fromLongArray(extended)))
       }
     
    -  private def generateKeyPrefixTestData(size: Int, rand: => Long): (LongArray, LongArray)
= {
    -    val ref = Array.tabulate[Long](size * 2) { i => rand }
    -    val extended = ref ++ Array.fill[Long](size * 2)(0)
    +  private def generateKeyPrefixTestData(size: Long, rand: => Long): (LongArray, LongArray)
= {
    +    val ref = Array.tabulate[Long]((size * 2).toInt) { i => rand }
    +    val extended = ref ++ Array.fill[Long]((size * 2).toInt)(0)
         (new LongArray(MemoryBlock.fromLongArray(ref)),
          new LongArray(MemoryBlock.fromLongArray(extended)))
       }
     
    -  private def collectToArray(array: LongArray, offset: Int, length: Int): Array[Long]
= {
    +  private def collectToArray(array: LongArray, offset: Int, length: Long): Array[Long]
= {
         var i = 0
    -    val out = new Array[Long](length)
    +    val out = new Array[Long](length.toInt)
    --- End diff --
    
    Did you forget to push?



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message