You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Uroš Bojanić (Jira)" <ji...@apache.org> on 2026/09/22 19:55:00 UTC
[jira] [Assigned] (SPARK-59428) Remove a dead emptiness guard in CollectFrequentItems.
[ https://issues.apache.org/jira/browse/SPARK-59428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Uroš Bojanić reassigned SPARK-59428:
------------------------------------
Assignee: David Mollitor
> Remove a dead emptiness guard in CollectFrequentItems.
> ------------------------------------------------------
>
> Key: SPARK-59428
> URL: https://issues.apache.org/jira/browse/SPARK-59428
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 4.1.0
> Reporter: David Mollitor
> Assignee: David Mollitor
> Priority: Trivial
> Labels: pull-request-available
>
> h2. Change
> Drop the guard and call {{min}} directly:
> {code:scala}
> // Non-empty here: this branch runs only when map.size >= size, and size > 0.
> val minCount = map.values.min
> {code}
> This removes the dead branch and one of the two {{map.values}} allocations on the eviction path. (HotSpot escape analysis may already scalar-replace the short-lived wrapper in hot compiled code, but that is not guaranteed; removing it at the source level does not rely on the JIT.)
> h2. Does this PR introduce _any_ user-facing change?
> No. The map is provably non-empty at this point, so the removed branch never executed; results are identical.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org