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

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

    [ https://issues.apache.org/jira/browse/SPARK-22957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16311323#comment-16311323 ] 

Apache Spark commented on SPARK-22957:
--------------------------------------

User 'juliuszsompolski' has created a pull request for this issue:
https://github.com/apache/spark/pull/20152

> 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