liujiayi771 commented on code in PR #43711:
URL: https://github.com/apache/spark/pull/43711#discussion_r1387434023
##########
sql/core/src/test/resources/sql-tests/results/group-by.sql.out:
##########
@@ -338,7 +338,7 @@ SELECT corr(DISTINCT x, y), corr(DISTINCT y, x), count(*)
-- !query schema
struct<corr(DISTINCT x, y):double,corr(DISTINCT y, x):double,count(1):bigint>
-- !query output
-1.0 1.0 3
+0.9999999999999999 0.9999999999999999 3
Review Comment:
The result is not incorrect, it is just a precision issue with double. For
example,
```java
2 / Math.sqrt(2 * 2) = 1.0
2 / Math.sqrt(2) / Math.sqrt(2) = 0.9999999999999999
```
From the user's perspective, 1.0 is more user-friendly.
I am currently unsure about whether to sacrifice user-friendliness in order
to support an extreme case.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]