Repository: kylin Updated Branches: refs/heads/master 58224921d -> 1a5295bad
measure encoding length bug Signed-off-by: Hongbin Ma <mahong...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/1a5295ba Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/1a5295ba Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/1a5295ba Branch: refs/heads/master Commit: 1a5295bad21fc18766bb3c7ba6eee59678d42185 Parents: 5822492 Author: luguosheng <550175...@qq.com> Authored: Thu Dec 1 17:54:35 2016 +0800 Committer: Hongbin Ma <mahong...@apache.org> Committed: Thu Dec 1 18:17:35 2016 +0800 ---------------------------------------------------------------------- webapp/app/js/controllers/cubeAdvanceSetting.js | 4 ++-- webapp/app/js/controllers/cubeEdit.js | 2 +- webapp/app/js/controllers/cubeMeasures.js | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/1a5295ba/webapp/app/js/controllers/cubeAdvanceSetting.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/cubeAdvanceSetting.js b/webapp/app/js/controllers/cubeAdvanceSetting.js index f2b36fe..8192419 100644 --- a/webapp/app/js/controllers/cubeAdvanceSetting.js +++ b/webapp/app/js/controllers/cubeAdvanceSetting.js @@ -47,7 +47,7 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function ($scope, $modal,cubeConfi var _encoding = item.encoding; var _valueLength ; var baseKey=item.encoding.replace(/:\d+/,''); - if(needLengthKeyList.indexOf(baseKey)>=-1){ + if(needLengthKeyList.indexOf(baseKey)!=-1){ var result=/:(\d+)/.exec(item.encoding); _valueLength=result?result[1]:0; } @@ -78,7 +78,7 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function ($scope, $modal,cubeConfi var version=$scope.getTypeVersion(item.encoding); var encodingType=$scope.removeVersion(item.encoding); - if(needLengthKeyList.indexOf(encodingType)>=-1){ + if(needLengthKeyList.indexOf(encodingType)!=-1){ encoding = encodingType+":"+item.valueLength; }else{ encoding = encodingType; http://git-wip-us.apache.org/repos/asf/kylin/blob/1a5295ba/webapp/app/js/controllers/cubeEdit.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js index 0704a62..85bd4b1 100755 --- a/webapp/app/js/controllers/cubeEdit.js +++ b/webapp/app/js/controllers/cubeEdit.js @@ -78,7 +78,7 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio $scope.store.supportedEncoding = $scope.cubeConfig.encodings; }) $scope.createFilter=function(type){ - if(type.indexOf("varchar")<=0){ + if(type.indexOf("varchar")==-1){ return ['fixed_length_hex']; }else if(type!="date"){ return ['date']; http://git-wip-us.apache.org/repos/asf/kylin/blob/1a5295ba/webapp/app/js/controllers/cubeMeasures.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/cubeMeasures.js b/webapp/app/js/controllers/cubeMeasures.js index 085338f..18f53c2 100644 --- a/webapp/app/js/controllers/cubeMeasures.js +++ b/webapp/app/js/controllers/cubeMeasures.js @@ -45,7 +45,7 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes } } $scope.createFilter=function(type){ - if(type.indexOf("varchar")<=0){ + if(type.indexOf("varchar")==-1){ return ['fixed_length_hex']; }else if(type!="date"){ return ['date']; @@ -60,7 +60,7 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes var encodings =$scope.store.supportedEncoding,filterEncoding=[]; var filerList=$scope.createFilter(type); if($scope.isEdit) { - if (name && $scope.newMeasure.function.configuration) { + if (name && $scope.newMeasure.function.configuration&&$scope.newMeasure.function.configuration['topn.encoding.' + name]) { var version = $scope.newMeasure.function.configuration['topn.encoding_version.' + name] || 1; filterEncoding = VdmUtil.getFilterObjectListByOrFilterVal(encodings, 'value', $scope.newMeasure.function.configuration['topn.encoding.' + name].replace(/:\d+/, "") + (version ? "[v" + version + "]" : "[v1]"), 'suggest', true); }else{ @@ -119,7 +119,7 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes var version=$scope.newMeasure.function.configuration['topn.encoding_version.'+_name]||1; item=$scope.removeVersion(item); var baseKey=item.replace(/:\d+/,''); - if(needLengthKeyList.indexOf(baseKey)>=-1){ + if(needLengthKeyList.indexOf(baseKey)!=-1){ var result=/:(\d+)/.exec(item); _valueLength=result?result[1]:0; } @@ -231,7 +231,7 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes var versionKey='topn.encoding_version.'+item.name; var version=$scope.getTypeVersion(item.encoding); var encoding=""; - if(needLengthKeyList.indexOf($scope.removeVersion(item.encoding))>=-1){ + if(needLengthKeyList.indexOf($scope.removeVersion(item.encoding))!=-1){ encoding = $scope.removeVersion(item.encoding)+":"+item.valueLength; }else{ encoding = $scope.removeVersion(item.encoding);