Repository: kylin
Updated Branches:
  refs/heads/2.1.x d0fe948d9 -> b322738fe


Revert "KYLIN-2604 Use global dict as the default encoding for precise distinct 
count in web"

This reverts commit 675881f5326224ca6723499604d8391ce894f05b.


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b322738f
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b322738f
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b322738f

Branch: refs/heads/2.1.x
Commit: b322738fe6f8583cc7d9ee19b2b945f3253763ff
Parents: d0fe948
Author: kangkaisen <kangkai...@meituan.com>
Authored: Wed Aug 9 19:41:12 2017 +0800
Committer: shaofengshi <shaofeng...@apache.org>
Committed: Sat Aug 12 15:11:45 2017 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeAdvanceSetting.js |  5 ++
 webapp/app/js/controllers/cubeEdit.js           | 52 --------------------
 webapp/app/js/controllers/cubeMeasures.js       |  7 ---
 3 files changed, 5 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/b322738f/webapp/app/js/controllers/cubeAdvanceSetting.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeAdvanceSetting.js 
b/webapp/app/js/controllers/cubeAdvanceSetting.js
index 8041a12..7d375da 100644
--- a/webapp/app/js/controllers/cubeAdvanceSetting.js
+++ b/webapp/app/js/controllers/cubeAdvanceSetting.js
@@ -187,6 +187,7 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function 
($scope, $modal,cubeConfi
   };
   $scope.initUpdateDictionariesStatus();
 
+
   $scope.addNewDictionaries = function (dictionaries, index) {
     if(dictionaries&&index>=0){
       $scope.updateDictionariesStatus.isEdit = true;
@@ -206,6 +207,10 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function 
($scope, $modal,cubeConfi
   };
 
   $scope.saveNewDictionaries = function (){
+    if(!$scope.cubeMetaFrame.dictionaries){
+      $scope.cubeMetaFrame.dictionaries=[];
+    }
+
     if($scope.updateDictionariesStatus.isEdit == true) {
       if 
($scope.cubeMetaFrame.dictionaries[$scope.updateDictionariesStatus.editIndex].column
 != $scope.newDictionaries.column) {
         if(!$scope.checkColumn()){

http://git-wip-us.apache.org/repos/asf/kylin/blob/b322738f/webapp/app/js/controllers/cubeEdit.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeEdit.js 
b/webapp/app/js/controllers/cubeEdit.js
index 5f78b61..0e5038e 100755
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -721,59 +721,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, 
$routeParams, $locatio
     }
   }
 
-  function reGenerateAdvancedDict () {
-    if (!$scope.cubeMetaFrame.dictionaries) {
-      $scope.cubeMetaFrame.dictionaries = [];
-    }
-
-    var distinctMeasures = [];
-
-    angular.forEach($scope.cubeMetaFrame.measures, function (measure, index) {
-      if (measure.function.expression === 'COUNT_DISTINCT' && 
measure.function.returntype === 'bitmap') {
-        var measureColumn = measure.function.parameter.value;
-        distinctMeasures.push(measureColumn);
-        //keep backward compatibility
-        distinctMeasures.push(VdmUtil.removeNameSpace(measureColumn))
-
-        var isColumnExit = false;
-        angular.forEach($scope.cubeMetaFrame.dictionaries, function 
(dictionaries) {
-          if (!isColumnExit) {
-            //keep backward compatibility
-            if (dictionaries.column == measureColumn || dictionaries.column == 
VdmUtil.removeNameSpace(measureColumn))
-              isColumnExit = true;
-          }
-        });
-
-        if (!isColumnExit) {
-          var dict = CubeDescModel.createDictionaries();
-          dict.column = measureColumn;
-          dict.builder = cubeConfig.buildDictionaries[0].value;
-          $scope.cubeMetaFrame.dictionaries.push(dict)
-        }
-      }
-    });
-
-    //get all reuse columns
-    var reuseColumns = [];
-    angular.forEach($scope.cubeMetaFrame.dictionaries, function (dict, index) {
-      if (dict.reuse != null && reuseColumns.indexOf(dict.reuse) === -1) {
-        reuseColumns.push(dict.reuse);
-      }
-    });
 
-    //remove deprecated distinct measures
-    angular.forEach($scope.cubeMetaFrame.dictionaries, function (dict, index) {
-      if (distinctMeasures.indexOf(dict.column) === -1 && 
reuseColumns.indexOf(dict.column) === -1) {
-        $scope.cubeMetaFrame.dictionaries.splice(index, 1);
-      }
-    });
-  }
-
-  $scope.$on('MeasuresEdited', function (event) {
-    if ($scope.cubeMetaFrame) {
-      reGenerateAdvancedDict();
-    }
-  });
 
   $scope.$on('DimensionsEdited', function (event) {
     if ($scope.cubeMetaFrame) {

http://git-wip-us.apache.org/repos/asf/kylin/blob/b322738f/webapp/app/js/controllers/cubeMeasures.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeMeasures.js 
b/webapp/app/js/controllers/cubeMeasures.js
index 347f3b7..17bc9ff 100644
--- a/webapp/app/js/controllers/cubeMeasures.js
+++ b/webapp/app/js/controllers/cubeMeasures.js
@@ -426,13 +426,6 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, 
$modal,MetaModel,cubes
     }
   }
 
-  if ($scope.state.mode == 'edit') {
-    $scope.$on('$destroy', function () {
-      // emit measures edit event in order to re-generate advanced dict.
-      $scope.$emit('MeasuresEdited');
-    });
-  }
-
 });
 
 var NextParameterModalCtrl = function ($scope, 
scope,para,$modalInstance,cubeConfig, CubeService, MessageService, $location, 
SweetAlert,ProjectModel, loadingRequest,ModelService) {

Reply via email to