[
https://issues.apache.org/jira/browse/SPARK-42227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17925165#comment-17925165
]
WenjunTao commented on SPARK-42227:
-----------------------------------
[~gurwls223] Hi, I also met the same problem, and I tried to solve it. The
reason maybe the merge sort in merge funciton of QuantileSummaries.scala file.
val mergedRes = (sampled ++ other.sampled).sortBy(_.value)
val comp = compressImmut(mergedRes, 2 * relativeError * count)
new QuantileSummaries(
other.compressThreshold, other.relativeError, comp, other.count + count, true)
This block is much faster than origin one.
!image-2025-02-08-14-25-08-423.png!
> Use approx_percentile function running slower than percentile in spark3
> ------------------------------------------------------------------------
>
> Key: SPARK-42227
> URL: https://issues.apache.org/jira/browse/SPARK-42227
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 3.2.1
> Reporter: xuanzhiang
> Priority: Major
> Attachments: image-2025-02-08-14-25-08-423.png,
> percentile+objectHashAggregateExec.png,
> percentile+objectHashAggregateExec_shuffle_task.png,
> percentile_approx+objectHashAggregateExec.png,
> percentile_approx+objectHashAggregateExec_shuffle_task.png
>
>
> approx_percentile(end_ts-start_ts,0.9) cost_p90
> in spark3 , it use objectHashAggregate method , but it shuffle very slow.
> when i use percentile , it become fast. i dont know the reson, i think
> approx_percentile should fast.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]