You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Juliusz Sompolski (JIRA)" <ji...@apache.org> on 2018/01/04 11:54:01 UTC

[jira] [Created] (SPARK-22957) ApproxQuantile breaks if the number of rows exceeds MaxInt

Juliusz Sompolski created SPARK-22957:
-----------------------------------------

             Summary: ApproxQuantile breaks if the number of rows exceeds MaxInt
                 Key: SPARK-22957
                 URL: https://issues.apache.org/jira/browse/SPARK-22957
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 2.2.1
            Reporter: Juliusz Sompolski


ApproxQuantile overflows when number of rows exceeds 2.147B (max int32).

If you run ApproxQuantile on a dataframe with 3B rows of 1 to 3B and ask it for 1/6 quantiles, it should return [0.5B, 1B, 1.5B, 2B, 2.5B, 3B]. However, in the [implementation of ApproxQuantile|https://github.com/apache/spark/blob/v2.2.0/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/QuantileSummaries.scala#L195], it calls .toInt on the target rank, which overflows at 2.147B.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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