yashmayya commented on code in PR #13616:
URL: https://github.com/apache/pinot/pull/13616#discussion_r1678966424


##########
compatibility-verifier/multi-stage-query-engine-test-suite/config/queries/feature-test-multi-stage.queries:
##########
@@ -20,7 +20,7 @@
 # Joins
 SELECT COUNT(*) FROM FeatureTest1 ft1 INNER JOIN FeatureTest2 ft2 ON 
ft1.stringDimSV1 = ft2.stringDimSV1 WHERE ft1.generationNumber = 
__GENERATION_NUMBER__ AND ft2.generationNumber = __GENERATION_NUMBER__
 SELECT ft1.stringDimSV1, COUNT(ft1.stringDimSV1) FROM FeatureTest1 ft1 INNER 
JOIN FeatureTest2 ft2 ON ft1.stringDimSV1 = ft2.stringDimSV1 WHERE 
ft1.generationNumber = __GENERATION_NUMBER__ AND ft2.generationNumber = 
__GENERATION_NUMBER__ GROUP BY ft1.stringDimSV1
-SELECT ft1.stringDimSV2, SUM(ft1.floatMetric1) FROM FeatureTest1 ft1 INNER 
JOIN FeatureTest2 ft2 ON ft1.stringDimSV1 = ft2.stringDimSV1 WHERE 
ft1.generationNumber = __GENERATION_NUMBER__ AND ft2.generationNumber = 
__GENERATION_NUMBER__ GROUP BY ft1.stringDimSV2
+SELECT ft1.stringDimSV2, SUM(ft1.doubleMetric1) FROM FeatureTest1 ft1 INNER 
JOIN FeatureTest2 ft2 ON ft1.stringDimSV1 = ft2.stringDimSV1 WHERE 
ft1.generationNumber = __GENERATION_NUMBER__ AND ft2.generationNumber = 
__GENERATION_NUMBER__ GROUP BY ft1.stringDimSV2

Review Comment:
   In the multi-stage query engine, aggregation results for `SUM` are the same 
type as the aggregated column type - so even though the `SUM` aggregation 
function currently uses `double` as the aggregation result holder, the end 
result will be cast to `FLOAT` (leading to loss in precision, and slightly 
inaccurate results). It's better to aggregate the `DOUBLE` column instead, so 
that we get predictable and accurate results.



-- 
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]

Reply via email to