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

fengYu commented on KYLIN-1833:
-------------------------------

the result is error. In kylin-2.x, the result is :
a  1987
b  5844
c  5844

and the right result is :
a  2021
b  7987
c  5946

in kylin-1.x, the id of OLAPContext is incorrect because for every subquery, 
kylin allocate a OLAPRel.OLAPImplementor and OLAPContext.id always equals to 0, 
which cause the generated code has some error. I move OLAPRel.OLAPImplementor 
to ThreadLocal virable and get right result.

However, in kylin-2.x, there are seems more effects, I am trying to find the 
reason in kylin-2.x

> union operation will cause error result
> ---------------------------------------
>
>                 Key: KYLIN-1833
>                 URL: https://issues.apache.org/jira/browse/KYLIN-1833
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Query Engine
>    Affects Versions: v1.3.0, v1.5.2
>            Reporter: fengYu
>            Assignee: fengYu
>
> query like this will get error result :
> select * from (
> select 'b',  count(1) from kylin_sales  where lstg_format_name >= 'Auction'
> union all
> select 'a',  count(1) from kylin_sales where lstg_format_name >= 'Others'
> union all 
> select 'c',  count(1) from kylin_sales  where lstg_format_name >= 'FP-GTC'
> ) order by 1



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

Reply via email to