kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zhong Yanghong (Jira)" <j...@apache.org>
Subject [jira] [Commented] (KYLIN-3361) Support stddev as a new measure
Date Fri, 06 Mar 2020 06:41:00 GMT

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

Zhong Yanghong commented on KYLIN-3361:
---------------------------------------

The sql 
{code}
select A, stddev(SUM_M)
from (
      select A, sampling_dim, sum(m) as SUM_M
      from T
      group by A, sampling_dim
) a
group by A
{code}
now can be expressed with udf *stddev_sum* like this
{code}
select A, stddev_sum(sampling_dim, m)
      from T
      group by A
{code}

> Support stddev as a new measure
> -------------------------------
>
>                 Key: KYLIN-3361
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3361
>             Project: Kylin
>          Issue Type: Sub-task
>            Reporter: Zhong Yanghong
>            Assignee: Zhong Yanghong
>            Priority: Major
>             Fix For: Backlog
>
>
> (x ~1~ - +x+) ^2^ + (x ~2~ - +x+) ^2^ + ... + (x ~n~ - +x+) ^2^ = x ~1~ ^2^ + x ~2~ ^2^
+ ... + x ~n~ ^2^ - n +x+ ^2^, where +x+ is the average of x ~1~, x ~2~, ..., x ~n~. Therefore,
to compute stddev, what kylin need to do is to pre-calculate sum(x ~i~ ^2^), sum(x ~i~) and
count



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message