You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Eric Yang (Jira)" <ji...@apache.org> on 2026/07/16 05:02:00 UTC

[jira] [Created] (SPARK-58164) approx_top_k_estimate and approx_top_k_combine fail on sketches whose item type was widened by type coercion

Eric Yang created SPARK-58164:
---------------------------------

             Summary: approx_top_k_estimate and approx_top_k_combine fail on sketches whose item type was widened by type coercion
                 Key: SPARK-58164
                 URL: https://issues.apache.org/jira/browse/SPARK-58164
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 5.0.0
            Reporter: Eric Yang


 A query that combines/estimates `approx_top_k` sketches whose item type is widened by type coercion (e.g. a `UNION ALL` of an INT and a BIGINT sketch column) fails at runtime.
{code:java}
 SELECT approx_top_k_estimate(approx_top_k_combine(sketch, 5))
 FROM (SELECT approx_top_k_accumulate(c) AS sketch, 'int' AS tag
         FROM VALUES (1), (1), (2) AS t(c)
       UNION ALL
       SELECT approx_top_k_accumulate(c) AS sketch, 'long' AS tag
         FROM VALUES (CAST(9 AS BIGINT)) AS t(c))
 WHERE tag = 'int';
– org.apache.datasketches.common.SketchesArgumentException:
--   Bounds Violation: reqOffset: 0, reqLength: 16, (reqOff + reqLen): 16, allocSize: 10 {code}
 



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