spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srowen <...@git.apache.org>
Subject [GitHub] spark pull request #19401: [SPARK-22176][SQL] Fix overflow issue in Dataset....
Date Sun, 01 Oct 2017 08:02:06 GMT
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19401#discussion_r142023186
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala ---
    @@ -237,7 +237,7 @@ class Dataset[T] private[sql](
        */
       private[sql] def showString(
           _numRows: Int, truncate: Int = 20, vertical: Boolean = false): String = {
    -    val numRows = _numRows.max(0)
    +    val numRows = _numRows.max(0).min(Int.MaxValue - 1)
    --- End diff --
    
    OK, but now you return one fewer row than expected when it's possible to return Int.MaxValue.
Granted this is an extreme corner case, but that seems less compelling than just skipping
the display of "more elements" in this case.


---

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


Mime
View raw message