kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chang chen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KYLIN-3566) Concating two dims in where clause is wrong
Date Mon, 17 Sep 2018 12:34:00 GMT
Chang chen created KYLIN-3566:
---------------------------------

             Summary: 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
         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)

Mime
View raw message