tanelk commented on a change in pull request #29515:
URL: https://github.com/apache/spark/pull/29515#discussion_r475214881
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
##########
@@ -793,7 +793,9 @@ case class EqualTo(left: Expression, right: Expression)
// | FALSE | FALSE | TRUE | UNKNOWN |
// | UNKNOWN | UNKNOWN | UNKNOWN | UNKNOWN |
// +---------+---------+---------+---------+
- protected override def nullSafeEval(left: Any, right: Any): Any =
ordering.equiv(left, right)
+ protected override def nullSafeEval(left: Any, right: Any): Any = {
+ left == right || ordering.equiv(left, right)
Review comment:
You are 100% correct.
It is an interesting problem, where the same comparator is used for both
sorting and equality check.
For sorting `-0.0` should be smaller than `0.0`, but in equality check they
should be equal.
Just for reference, it seems that both hive and mysql consider them equal in
the equality check:
https://issues.apache.org/jira/browse/HIVE-11174
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]