[ 
https://issues.apache.org/jira/browse/KYLIN-3812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zhong Yanghong updated KYLIN-3812:
----------------------------------
    Description: 
Currently it's not well supported for CompareTupleFilter to have a child of 
CompareTupleFilter. However, in some cases, it's better to support it.
{code}
where (colA = (1=1))
{code}
The *(1=1)* can be transformed to "true". And then this filter can be pushed 
down to hbase. Otherwise, the filter *(colA = (1=1))* does not work in hbase.

And it may return incorrect results for the following SQL:
{code}
select colA
       case
           when colB = (1 = 1) then 'B'
           when colC = (1 = 1) then 'C'
           when colD = (1 = 1) then 'D'
           else 'n/a'
       end as phase,
       count(*)
from T
where session_date between '2018-08-01' and '2018-08-31'
group by colA
       case
           when colB = (1 = 1) then 'B'
           when colC = (1 = 1) then 'C'
           when colD = (1 = 1) then 'D'
           else 'n/a'
       end;
{code}

In the final result, all of the keys will become 'B'.

  was:
Currently it's not well supported for CompareTupleFilter to have a child of 
CompareTupleFilter. However, in some cases, it's better to support it.
{code}
where (colA = (1=1))
{code}
The *(1=1)* can be transformed to "true". And then this filter can be pushed 
down to hbase. Otherwise, the filter *(colA = (1=1))* does not work in hbase.


> optimize the child CompareTupleFilter in a CompareTupleFilter
> -------------------------------------------------------------
>
>                 Key: KYLIN-3812
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3812
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Query Engine
>            Reporter: Zhong Yanghong
>            Assignee: Zhong Yanghong
>            Priority: Major
>             Fix For: v3.0.0
>
>
> Currently it's not well supported for CompareTupleFilter to have a child of 
> CompareTupleFilter. However, in some cases, it's better to support it.
> {code}
> where (colA = (1=1))
> {code}
> The *(1=1)* can be transformed to "true". And then this filter can be pushed 
> down to hbase. Otherwise, the filter *(colA = (1=1))* does not work in hbase.
> And it may return incorrect results for the following SQL:
> {code}
> select colA
>        case
>            when colB = (1 = 1) then 'B'
>            when colC = (1 = 1) then 'C'
>            when colD = (1 = 1) then 'D'
>            else 'n/a'
>        end as phase,
>        count(*)
> from T
> where session_date between '2018-08-01' and '2018-08-31'
> group by colA
>        case
>            when colB = (1 = 1) then 'B'
>            when colC = (1 = 1) then 'C'
>            when colD = (1 = 1) then 'D'
>            else 'n/a'
>        end;
> {code}
> In the final result, all of the keys will become 'B'.



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

Reply via email to