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

Zhixiong Chen resolved KYLIN-2789.
----------------------------------
       Resolution: Fixed
    Fix Version/s: v2.2.0

> Cube's last build time is wrong
> -------------------------------
>
>                 Key: KYLIN-2789
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2789
>             Project: Kylin
>          Issue Type: Bug
>          Components: REST Service, Web 
>    Affects Versions: v1.6.0
>            Reporter: Hongtao He
>            Assignee: Zhixiong Chen
>            Priority: Minor
>              Labels: cube.last_build_time, cube.segments
>             Fix For: v2.2.0
>
>         Attachments: 0001-KYLIN-2789-jira-description.patch, KYLIN-2789.patch
>
>
> Firstly, we create a segment in a cube, then we can get the attributes of 
> this segment,such as
>  { "date_range_start " : 2017-08-02 00:00:00,
> "date_range_end" : 2017-08-03 00:00:00,
> "last_build_time": 2017-08-16 01:00:00
> }
> Secondly, we create another segment in this cube, which has an earlier data 
> range,such as
>  { "date_range_start " : 2017-08-01 00:00:00,
> "date_range_end" : 2017-08-02 00:00:00,
> "last_build_time": 2017-08-16 02:00:00
> }
> Under these circumstances, the Cube's last creation time should be 2017-08-16 
> 02:00:00, not 2017-08-16 01:00:00.However, we get the opposite answer  in 
> kylin 1.6.0.
> the realization of cube's last build time is  :
>  if(cube.name){
>                     if (cube.segments && cube.segments.length > 0) {
>                         for(var i= cube.segments.length-1;i>=0;i--){
>                             if(cube.segments[i].status==="READY"){
>                                cube.last_build_time = 
> cube.segments[i].last_build_time;
>                                 break;
>                             }else if(i===0){
>                                 cube.last_build_time = undefined;
>                             }
>                         }
>                     } else {
>                         cube.last_build_time = undefined;
>                     }
>                 }
> (the code is in kylin/webapp/app/js/model/cubeListModel.js)
> The last build time may come from any segment,I changed the code to the 
> following:
> if(cube.name){
>                     cube.last_build_time = undefined;
>                     if (cube.segments && cube.segments.length > 0) {
>                         for(var i= cube.segments.length-1;i>=0;i--){
>                             if(cube.segments[i].status==="READY"){
>                                if(cube.last_build_time===undefined || 
> cube.last_build_time<cube.segments[i].last_build_time)                        
>     
>                                       cube.last_build_time = 
> cube.segments[i].last_build_time;
>                             }
>                         }
>                     }
>                 }



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

Reply via email to