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/09 12:13:00 UTC

[jira] [Commented] (SPARK-23005) Improve RDD.take on small number of partitions

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

Apache Spark commented on SPARK-23005:
--------------------------------------

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

> Improve RDD.take on small number of partitions
> ----------------------------------------------
>
>                 Key: SPARK-23005
>                 URL: https://issues.apache.org/jira/browse/SPARK-23005
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 2.2.1
>            Reporter: Gengliang Wang
>
> In current implementation of RDD.take, we overestimate the number of partitions we need to try by 50%:
> `(1.5 * num * partsScanned / buf.size).toInt`
> However, when the number is small, the result of `.toInt` is not what we want. 
> E.g, 2.9 will become 2, which should be 3.
> Use math.Ceil fix the problem.



--
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