[ 
https://issues.apache.org/jira/browse/FLINK-4604?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15615280#comment-15615280
 ] 

Anton Mushin commented on FLINK-4604:
-------------------------------------

I found rootcause

problems occur only in query with SUM, if in query replace SUM to $SUM0 (or any 
aggregate function) then query works.
At time execute {{AggregateReduceFunctionsRule#onMatch}} SUM must replace to 
$SUM0 
[here|https://github.com/apache/calcite/blob/0938c7b6d767e3242874d87a30d9112512d9243a/core/src/main/java/org/apache/calcite/rel/rules/AggregateReduceFunctionsRule.java#L338]
But it is not happening because the types in FLINK is nullable. ( in my case)

I do not know how to solve this problem yet, please let me know if you have 
idea how resolve this problem.

> Add support for standard deviation/variance
> -------------------------------------------
>
>                 Key: FLINK-4604
>                 URL: https://issues.apache.org/jira/browse/FLINK-4604
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: Timo Walther
>            Assignee: Anton Mushin
>         Attachments: 1.jpg
>
>
> Calcite's {{AggregateReduceFunctionsRule}} can convert SQL {{AVG, STDDEV_POP, 
> STDDEV_SAMP, VAR_POP, VAR_SAMP}} to sum/count functions. We should add, test 
> and document this rule. 
> If we also want to add this aggregates to Table API is up for discussion.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to