You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Vsevolod Ostapenko (JIRA)" <ji...@apache.org> on 2019/07/02 19:51:00 UTC

[jira] [Comment Edited] (KYLIN-3628) Query with lookup table always use latest snapshot

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

Vsevolod Ostapenko edited comment on KYLIN-3628 at 7/2/19 7:50 PM:
-------------------------------------------------------------------

Hi XiaoXiang, thank you for a quick turnaround with a fix.
 I looked at the code change, and the following check seems too restrictive: 
{code:java}
if (dimensionDesc.isDerived() && dimensionDesc.getTable().equalsIgnoreCase(lookupTbl)) {
{code}
Per my internal tests, the entire lookup table is being snapshotted as part of a cube, if any dimension (non-derived or otherwise) is supplied by that table. So, dimension doesn't have to be derived.
 In fact, in my test cubes there is no derived dimensions at all (all "derived" properties for all the lookup tables are set to null), it does not prevent executing "select * from lookupTable" against such cube on a non-patched 2.6.2 system.

To summarize, I believe that the "dimensionDesc.isDerived()" call should be removed from the expression above.

 

Edit: I have to stay corrected, for the lookup table only the columns that are normal or derived dimensions are being snapshotted (not the entire table). Still, it doesn't change the stance that the "derived" check is not needed in the expression above.


was (Author: seva_ostapenko):
Hi XiaoXiang, thank you for a quick turnaround with a fix.
I looked at the code change, and the following check seems too restrictive: 
{code:java}
if (dimensionDesc.isDerived() && dimensionDesc.getTable().equalsIgnoreCase(lookupTbl)) {
{code}
Per my internal tests, the entire lookup table is being snapshotted as part of a cube, if any dimension (non-derived or otherwise) is supplied by that table. So, dimension doesn't have to be derived.
In fact, in my test cubes there is no derived dimensions at all (all "derived" properties for all the lookup tables are set to null), it does not prevent executing "select * from lookupTable" against such cube on a non-patched 2.6.2 system.

To summarize, I believe that the "dimensionDesc.isDerived()" call should be removed from the expression above.

> Query with lookup table always use latest snapshot
> --------------------------------------------------
>
>                 Key: KYLIN-3628
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3628
>             Project: Kylin
>          Issue Type: Improvement
>            Reporter: Na Zhai
>            Assignee: Na Zhai
>            Priority: Major
>             Fix For: v2.6.0
>
>
> If user queries a lookup table, Kylin will randomly selects a Cube (which has the snapshot of this lookup table) to answer it. This causes uncertainty when there are multiple cubes (share the same lookup): some cubes are newly built, some not. If Kylin picks an old cube, the query result is old.
> To remove this uncertainty, for such queries, either always use latest snapshot, or use earlist snapshot. We believe the "latest" version is better.



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