kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaofeng SHI (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (KYLIN-3001) Cache key issue
Date Sat, 04 Nov 2017 12:44:00 GMT

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

Shaofeng SHI edited comment on KYLIN-3001 at 11/4/17 12:43 PM:
---------------------------------------------------------------

Good catch; +1

In my opinion, using the whole SQL as part of the key is inefficient. Calculating a hash value
should be more efficient, and it doesn't need any regular expression.
[~liyang.gmt8@gmail.com] Yang, is there any concern?


was (Author: shaofengshi):
Good catch; +1

In my mind, using the whole SQL as part of the key is inefficient. Calculating a hash value
should be more effective, and it doesn't need such conversion.
[~liyang.gmt8@gmail.com] Yang, is there any concern?

> Cache key issue 
> ----------------
>
>                 Key: KYLIN-3001
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3001
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: v2.1.0
>            Reporter: Pan, Julian
>            Assignee: liyang
>            Priority: Major
>         Attachments: KYLIN_3001_Cache_key_issue.patch
>
>
> Currently the cacheKey generate by SQLRequest getCacheKey:
> cacheKey = Lists.newArrayList(sql.replaceAll("\\s+", ""), project, offset, limit, acceptPartial,
>                 backdoorToggles);
> Which will remove all the space and break line.
> If I have a sql:
> select a, sum(c) from table 
> --where a > 0 group by a;
> and another sql:
> select a, sum(c) from table 
> --where a > 0 
> group by a;
> The two sql will share same cache key.
> But the first sql should be break. If you query second sql, and then query the first
again. It will return result.
> And another issue is if remove all space, which will mix a as b and aasb.
> I think the better way is just replace multiple space to one space
> Should I create a patch? Or just provide the fix:
> cacheKey = Lists.newArrayList(sql.replaceAll("[ ]", " "), project, offset, limit, acceptPartial,
>                 backdoorToggles);



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message