Stamatis Zampetakis created CALCITE-4204: --------------------------------------------
Summary: Intermittent precision in Druid results when using aggregation functions over columns of type DOUBLE Key: CALCITE-4204 URL: https://issues.apache.org/jira/browse/CALCITE-4204 Project: Calcite Issue Type: Bug Components: druid-adapter Environment: The results were obtained by using a dockerized Druid at 0.17.1: [https://github.com/zabetak/calcite-druid-dataset] Reporter: Stamatis Zampetakis Queries with aggregation functions on columns of type DOUBLE return results where the precision of the columns involved in the computation may differ from one execution to the other. Consider the following query which can be found under DruidAdapterIT#testSingleAverageFunction. {code:sql} select "store_state", sum("store_cost") / count(*) as a from "foodmart" group by "store_state" order by a desc {code} The same query executed multiple times returns different results +Result 1+ {noformat} store_state=OR; A=2.6271402406293403 store_state=CA; A=2.599338206292706 store_state=WA; A=2.582870859286872 {noformat} +Result 2+ {noformat} store_state=OR; A=2.62714024062934 store_state=CA; A=2.599338206292706 store_state=WA; A=2.582870859286872 {noformat} +Result 3+ {noformat} store_state=OR; A=2.6271402406293394 store_state=CA; A=2.599338206292706 store_state=WA; A=2.582870859286872 {noformat} Column "store_cost" in Druid is defined as shown below: {noformat} "metricsSpec" : [ ... { "name" : "store_sales", "type" : "doubleSum", "fieldName" : "store_sales" } ...] {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)