[
https://issues.apache.org/jira/browse/CALCITE-1661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15886139#comment-15886139
]
Julian Hyde commented on CALCITE-1661:
--------------------------------------
I see that
[FRACTIONAL_TYPES|https://github.com/apache/calcite/blob/0938c7b6d767e3242874d87a30d9112512d9243a/core/src/main/java/org/apache/calcite/sql/type/SqlTypeName.java#L168]
= approximate types (DOUBLE + FLOAT) plus DECIMAL. Should we include DECIMAL?
I find that it's a mistake to mix exact types with inexact types.
To be clear, I'm not proposing to redefine FRACTIONAL_TYPES. I'm proposing that
we use APPROX_TYPES for recognizing aggregation function types.
> Recognize aggregation function types as FRACTIONAL instead of DOUBLE
> --------------------------------------------------------------------
>
> Key: CALCITE-1661
> URL: https://issues.apache.org/jira/browse/CALCITE-1661
> Project: Calcite
> Issue Type: Bug
> Components: druid
> Affects Versions: 1.12.0
> Reporter: Jesus Camacho Rodriguez
> Assignee: Jesus Camacho Rodriguez
> Fix For: 1.12.0
>
>
> Currently, whether to use fractional or integer aggregations is based on
> following code (L699 in DruidQuery.java).
> {code}
> final boolean b = aggCall.getType().getSqlTypeName() == SqlTypeName.DOUBLE;
> {code}
> Since Hive might use other fractional types for the aggregation, we might end
> up using the wrong type of aggregation in Druid. We could extend the check as
> follows:
> {code}
> final boolean b =
> SqlTypeName.FRACTIONAL_TYPES.contains(aggCall.getType().getSqlTypeName());
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)