Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix NaN values in Spark collect_set aggregate function #12335

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rui-mo
Copy link
Collaborator

@rui-mo rui-mo commented Feb 14, 2025

In Spark collect_set aggregate function, NaN values are considered distinct.

spark.sql("SELECT collect_set(col) FROM VALUES (1), (1), (cast('NaN' as double)), (cast('NaN' as double)) AS tab(col)").show()
+----------------+
|collect_set(col)|
+----------------+
| [1.0, NaN, NaN]|
+----------------+

Fixes #12336.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 14, 2025
Copy link

netlify bot commented Feb 14, 2025

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit c2cc47c
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/67cecc568695fc0008bc97b0

Copy link
Contributor

@zhli1142015 zhli1142015 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rui-mo
Copy link
Collaborator Author

rui-mo commented Feb 27, 2025

@Yuhta Would you please help review this change? Thanks!

@rui-mo rui-mo force-pushed the wip_collect_set branch from fc6e5a8 to f72d203 Compare March 5, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected result in the Spark collect_set aggregate function
3 participants