You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/07/15 22:35:00 UTC
[jira] [Updated] (SPARK-58095) approx_top_k_combine fails the query with an internal error (MatchError) on empty input
[ https://issues.apache.org/jira/browse/SPARK-58095?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated SPARK-58095:
-----------------------------------
Labels: pull-request-available (was: )
> approx_top_k_combine fails the query with an internal error (MatchError) on empty input
> ---------------------------------------------------------------------------------------
>
> Key: SPARK-58095
> URL: https://issues.apache.org/jira/browse/SPARK-58095
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 5.0.0
> Reporter: Eric Yang
> Priority: Major
> Labels: pull-request-available
>
> When `approx_top_k_combine` aggregates over zero input rows -- an empty input, or one fully removed by a filter -- the whole query fails with an internal error (scala.MatchError: null) instead of returning an empty result. This surfaces to the user as a SparkException / aborted job.
> *Repro*:
> {code:sql}
> SELECT approx_top_k_combine(sketch, 5)
> FROM (SELECT approx_top_k_accumulate(expr) AS sketch FROM VALUES (1), (2) AS t(expr))
> WHERE false;
> -- org.apache.spark.SparkException: Job aborted due to stage failure:
> -- ... scala.MatchError: null
> {code}
> The other approx_top_k functions (approx_top_k, approx_top_k_accumulate, approx_top_k_estimate) are not affected -- only approx_top_k_combine.
--
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