chenzhx closed pull request #161: KYLIN-3440 Couldn't merge if there is an 
empty segment
URL: https://github.com/apache/kylin/pull/161
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/webapp/app/js/controllers/cubes.js 
b/webapp/app/js/controllers/cubes.js
index 136d86eacf..d5541fb008 100644
--- a/webapp/app/js/controllers/cubes.js
+++ b/webapp/app/js/controllers/cubes.js
@@ -640,19 +640,15 @@ var jobSubmitCtrl = function ($scope, $modalInstance, 
CubeService, MessageServic
     startTime = cube.segments[cube.segments.length-1].date_range_end;
   }
   $scope.jobBuildRequest.startTime=startTime;
-  $scope.rebuild = function () {
-
+  $scope.rebuild = function (isForce) {
     $scope.message = null;
-
     if ($scope.jobBuildRequest.startTime >= $scope.jobBuildRequest.endTime) {
       $scope.message = "WARNING: End time should be later than the start 
time.";
-
       return;
     }
-
+    $scope.jobBuildRequest.forceMergeEmptySegment = !!isForce;
     loadingRequest.show();
     CubeService.rebuildCube({cubeId: cube.name}, $scope.jobBuildRequest, 
function (job) {
-
       loadingRequest.hide();
       $modalInstance.dismiss('cancel');
       SweetAlert.swal('Success!', 'Rebuild job was submitted successfully', 
'success');
@@ -660,8 +656,6 @@ var jobSubmitCtrl = function ($scope, $modalInstance, 
CubeService, MessageServic
           $scope.cubeList.cubes[$scope.cubeList.cubes.indexOf(cube)] = _cube;
         });
     }, function (e) {
-
-
       loadingRequest.hide();
       if (e.data && e.data.exception) {
         var message = e.data.exception;
@@ -677,14 +671,11 @@ var jobSubmitCtrl = function ($scope, $modalInstance, 
CubeService, MessageServic
             closeOnConfirm: true
           }, function (isConfirm) {
             if (isConfirm) {
-              $scope.jobBuildRequest.forceMergeEmptySegment = true;
-              $scope.rebuild();
-              delete $scope.jobBuildRequest.forceMergeEmptySegment;
+              $scope.rebuild(true);
             }
           });
           return;
         }
-
         if(message.indexOf("Merging segments must not have gaps between")!=-1){
           SweetAlert.swal({
             title:'',
@@ -695,9 +686,7 @@ var jobSubmitCtrl = function ($scope, $modalInstance, 
CubeService, MessageServic
             closeOnConfirm: true
           }, function (isConfirm) {
             if (isConfirm) {
-              $scope.jobBuildRequest.forceMergeEmptySegment = true;
-              $scope.rebuild();
-              delete $scope.jobBuildRequest.forceMergeEmptySegment;
+              $scope.rebuild(true);
             }
           });
           return;


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to