Hongtao He created KYLIN-2789:
---------------------------------
Summary: 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
Affects Versions: v1.6.0
Reporter: Hongtao He
Assignee: Zhong,Jason
Priority: Minor
Fix For: v1.6.0
Attachments: cubeListModel.js.js
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"){
{color:red} cube.last_build_time =
cube.segments[i].last_build_time;
break;{color}
}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)