Skip to content

Conversation

@findepi
Copy link
Member

@findepi findepi commented Jun 30, 2025

Fix calls to ScalarValue::partial_cmp that treat None return value as equivalent to equality. The partial_cmp returns None when values cannot be compared, for example they have incompatible types. Apparently, in all these places it is an error condition when values cannot be compared.

@github-actions github-actions bot added optimizer Optimizer rules core Core DataFusion crate common Related to common crate functions Changes to functions implementation labels Jun 30, 2025
findepi added 2 commits June 30, 2025 14:51
Fix calls to `ScalarValue::partial_cmp` that treat `None` return value
as equivalent to equality. The `partial_cmp` returns `None` when values
cannot be compared, for example they have incompatible types.
Apparently, in all these places it is an error condition when values
cannot be compared.
@findepi findepi force-pushed the findepi/avoid-treating-incomparable-scalars-as-equal-bed985 branch from 6843dbb to 6d1654f Compare June 30, 2025 12:51
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @findepi -- I think this will improve our ability to find and fix bugs 👍

findepi and others added 2 commits July 1, 2025 00:41
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@findepi findepi merged commit 47f75ef into apache:main Jul 1, 2025
27 checks passed
@findepi findepi deleted the findepi/avoid-treating-incomparable-scalars-as-equal-bed985 branch July 1, 2025 09:42
jcsherin added a commit to jcsherin/datafusion that referenced this pull request Nov 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common Related to common crate core Core DataFusion crate functions Changes to functions implementation optimizer Optimizer rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants