kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaofeng SHI (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KYLIN-3476) Fix TupleExpression verification when parsing sql
Date Wed, 01 Aug 2018 02:46:00 GMT

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

Shaofeng SHI commented on KYLIN-3476:
-------------------------------------

I see; the logic is a little complicated. It would be better if adding some comments in the
code; 

> Fix TupleExpression verification when parsing sql
> -------------------------------------------------
>
>                 Key: KYLIN-3476
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3476
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: v2.4.0
>            Reporter: Zhong Yanghong
>            Assignee: Zhong Yanghong
>            Priority: Major
>             Fix For: v2.5.0
>
>         Attachments: APACHE-KYLIN-3476.patch
>
>
> Previously there's a validation check for sql, since dynamic column does not support
{{sum(col1/col2)}}. However, if the sql has a subquery and {{sum(col1/col2)}} is in the main
query rather than the sub-query, this should be OK. One example is as follows:
> {code}
> select T1.D1, sum(T1.gmv/T2.gmv)
> from 
> (select D1, D2, sum(M1) as gmv
> from T
> group by D1, D2) T1
> inner join
> (select D1, D2, sum(M2) as gmv
> from T
> group by D1, D2) T2
> on T1.D1 = T2.D1
> group by T1.D1
> {code}
> Since the outside {{sum(T1.gmv/T2.gmv)}} is handled by calcite rather than Kylin, it's
OK and should not go through the verification.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message