You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Chang chen (JIRA)" <ji...@apache.org> on 2018/09/17 12:35:00 UTC

[jira] [Updated] (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 ]

Chang chen updated KYLIN-3566:
------------------------------
    Description: 
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"

 

  was:
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"

 


> 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
>            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
(v7.6.3#76005)