[
https://issues.apache.org/jira/browse/SPARK-44999?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dongjoon Hyun reassigned SPARK-44999:
-------------------------------------
Assignee: Yang Jie
> Refactor ExternalSorter to reduce checks on shouldPartition when calling
> getPartition
> -------------------------------------------------------------------------------------
>
> Key: SPARK-44999
> URL: https://issues.apache.org/jira/browse/SPARK-44999
> Project: Spark
> Issue Type: Improvement
> Components: Spark Core
> Affects Versions: 4.0.0
> Reporter: Yang Jie
> Assignee: Yang Jie
> Priority: Minor
>
> {code:java}
> private def getPartition(key: K): Int = {
> if (shouldPartition) partitioner.get.getPartition(key) else 0
> } {code}
>
> The {{getPartition}} method checks {{shouldPartition}} every time it is
> called. However, {{shouldPartition}} should not be able to change after the
> {{ExternalSorter}} is instantiated. Therefore, it can be refactored to reduce
> the checks on {{{}shouldPartition{}}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]