You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Yaqian Zhang (Jira)" <ji...@apache.org> on 2020/04/27 03:42:00 UTC

[jira] [Assigned] (KYLIN-3566) Concating two dims in where clause is wrong

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

Yaqian Zhang reassigned KYLIN-3566:
-----------------------------------

    Assignee: Yaqian Zhang

> Concating two dims in where clause is wrong
> -------------------------------------------
>
>                 Key: KYLIN-3566
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3566
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: v2.4.0
>            Reporter: Chang chen
>            Assignee: Yaqian Zhang
>            Priority: Major
>         Attachments: image-2018-09-17-20-27-04-025.png
>
>
> The following SQL returns less data:
> {quote}SELECT 
>      concat(concat("DATE",' '), minutes) AS "__timestamp",
>      count( * ) as pv
>  FROM kylin."MODEL_MODELSERVER"
>  WHERE concat(concat("DATE",' '), minutes) >= '2018-09-04 00:00:00'
>  GROUP BY concat(concat("DATE",' '), minutes)
>  order by "__timestamp"
> {quote}
> If I rewrite where as 
> {quote}  ("DATE" = '2018-09-04' and minutes >= '01:00') or "DATE" >= '2018-09-05'
> {quote}
> The Result sets are correct. This is because *BuiltInFunctionTransformer.translateFunctionTupleFilter* only pass the _minutes_ to *concat*. see the codes in red rectangle.
> !image-2018-09-17-20-27-04-025.png!
> And hence  for _concat(concat("DATE",' '), minutes) >= '2018-09-04 00:00:00'_,  it actually evals _minutes >=_ _'2018-09-04 00:00:00'_ ,  which gets true  when minutes >= "20:00"
>  



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