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/06/07 03:35:00 UTC
[jira] [Updated] (SPARK-57298) collect_set returns duplicate NaN values for float/double columns
[ https://issues.apache.org/jira/browse/SPARK-57298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated SPARK-57298:
-----------------------------------
Labels: pull-request-available (was: )
> collect_set returns duplicate NaN values for float/double columns
> -----------------------------------------------------------------
>
> Key: SPARK-57298
> URL: https://issues.apache.org/jira/browse/SPARK-57298
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 5.0.0
> Reporter: Eric Yang
> Priority: Major
> Labels: pull-request-available
>
> `collect_set` is documented to return a set of distinct elements, and under Spark SQL semantics all NaN values are equal (and `-0.0 == 0.0`). However, `collect_set` over float/double columns returns duplicate `NaN` elements:
> {code:java}
> SELECT collect_set(v) FROM VALUES (double('NaN')), (double('NaN')) AS t(v);
> -- actual: [NaN, NaN]
> -- expected: [NaN] {code}
> This is inconsistent with array_distinct , count(DISTINCT), grouping/join/window keys, and the array set operations - all of which treat NaNs as equal.
>
>
--
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