You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "deniskuzZ (via GitHub)" <gi...@apache.org> on 2025/07/01 07:54:56 UTC
Re: [PR] [CALCITE-6080] The simplified form after applying AggregateReduceFunctionsRule is giving wrong results for STDDEV, Covariance with double and decimal types [calcite]
deniskuzZ commented on code in PR #4448:
URL: https://github.com/apache/calcite/pull/4448#discussion_r2176721447
##########
testkit/src/main/java/org/apache/calcite/test/SqlOperatorTest.java:
##########
@@ -15906,6 +15909,9 @@ void testTimestampDiff(boolean coercionEnabled) {
f.checkType("variance(cast(null as varchar(2)))", "DECIMAL(19, 9)");
f.checkType("variance(CAST(NULL AS INTEGER))", "INTEGER");
f.checkAggType("variance(DISTINCT 1.5)", "DECIMAL(2, 1) NOT NULL");
+
+ final String[] values2 = {"cast(64.34 as double)", "64.34", "64.34"};
+ f.checkAgg("variance(x)", values2, isExactly(0));
Review Comment:
In that specific case, we return exactly 0 (BigDecimal.ZERO)
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org