You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jiatao Tao (Jira)" <ji...@apache.org> on 2020/09/04 02:35:00 UTC
[jira] [Commented] (CALCITE-4204) Intermittent precision in Druid
results when using aggregation functions over columns of type DOUBLE
[ https://issues.apache.org/jira/browse/CALCITE-4204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17190494#comment-17190494 ]
Jiatao Tao commented on CALCITE-4204:
-------------------------------------
Double comparison is a common problem is a SQL system, I think it is identical with expectation, we should provide a method compare the double result to let this pass.
> 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
> Priority: Major
>
> 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)