You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ch...@apache.org on 2017/07/30 10:04:33 UTC

kylin git commit: KYLIN 2768 wrong UI for count distinct measure

Repository: kylin
Updated Branches:
  refs/heads/2.1.x 0a383dcf7 -> 71589d64f


KYLIN 2768 wrong  UI for count distinct measure


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

Branch: refs/heads/2.1.x
Commit: 71589d64feca1da7e04168a5666a1f70becefddc
Parents: 0a383dc
Author: chenzhx <34...@qq.com>
Authored: Sun Jul 30 18:04:07 2017 +0800
Committer: chenzhx <34...@qq.com>
Committed: Sun Jul 30 18:04:07 2017 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeMeasures.js      | 18 +++++++++++-------
 webapp/app/partials/cubeDesigner/measures.html |  5 ++---
 2 files changed, 13 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/71589d64/webapp/app/js/controllers/cubeMeasures.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeMeasures.js b/webapp/app/js/controllers/cubeMeasures.js
index 8b0271c..347f3b7 100644
--- a/webapp/app/js/controllers/cubeMeasures.js
+++ b/webapp/app/js/controllers/cubeMeasures.js
@@ -218,7 +218,7 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes
           $scope.newMeasure.function.configuration[versionKey]=version;
           });
     }
-    if ($scope.newMeasure.function.expression === 'COUNT_DISTINCT' ) {
+    if ($scope.newMeasure.function.expression === 'COUNT_DISTINCT' && $scope.newMeasure.function.returntype!=='bitmap') {
 
       var hasExisted = [];
 
@@ -344,16 +344,20 @@ KylinApp.controller('CubeMeasuresCtrl', function ($scope, $modal,MetaModel,cubes
   }
 
   //map right return type for param
-  $scope.measureReturnTypeUpdate = function(){
+  $scope.measureReturnTypeUpdate = function() {
 
-    if($scope.newMeasure.function.expression == 'TOP_N'){
-      if($scope.newMeasure.function.parameter.type==""||!$scope.newMeasure.function.parameter.type){
-        $scope.newMeasure.function.parameter.type= 'column';
+    if ($scope.newMeasure.function.expression == 'TOP_N') {
+      if ($scope.newMeasure.function.parameter.type == "" || !$scope.newMeasure.function.parameter.type) {
+        $scope.newMeasure.function.parameter.type = 'column';
       }
-      $scope.convertedColumns=[];
+      $scope.convertedColumns = [];
       $scope.newMeasure.function.returntype = "topn(100)";
       return;
-    }else if($scope.newMeasure.function.expression == 'EXTENDED_COLUMN'){
+    } else if ($scope.newMeasure.function.expression == 'COUNT_DISTINCT') {
+      $scope.newMeasure.function.parameter.type= 'column';
+      $scope.newMeasure.function.returntype = "hllc(10)";
+      $scope.convertedColumns = [];
+    } else if($scope.newMeasure.function.expression == 'EXTENDED_COLUMN'){
       $scope.newMeasure.function.parameter.type= 'column';
       $scope.newMeasure.function.returntype = "extendedcolumn(100)";
       return;

http://git-wip-us.apache.org/repos/asf/kylin/blob/71589d64/webapp/app/partials/cubeDesigner/measures.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/measures.html b/webapp/app/partials/cubeDesigner/measures.html
index 89c7142..8a5cae9 100755
--- a/webapp/app/partials/cubeDesigner/measures.html
+++ b/webapp/app/partials/cubeDesigner/measures.html
@@ -69,7 +69,6 @@
               </table>
       </div>
   </ng-form>
-
   <!--Add Measures Button-->
   <div class="form-group">
       <button class="btn btn-sm btn-info" ng-click="addNewMeasure()" ng-show="state.mode=='edit' && !newMeasure" ng-disabled="instance.status=='READY'">
@@ -218,10 +217,10 @@
                       </div>
 
                       <!--Group by Column-->
-                      <div class="form-group" ng-if="newMeasure.function.expression === 'TOP_N'||newMeasure.function.expression === 'COUNT_DISTINCT'" >
+                      <div class="form-group" ng-if="newMeasure.function.expression === 'TOP_N'||(newMeasure.function.expression === 'COUNT_DISTINCT' && newMeasure.function.returntype!=='bitmap')" >
                         <div class="row">
                           <label class="col-xs-12 col-sm-3 control-label no-padding-right font-color-default">
-                            <b>Group by Column</b>
+                            <b ng-if="newMeasure.function.expression === 'TOP_N'">Group by Column</b>
                           </label>
                           <div class="form-group large-popover" >
                               <div class="box-body">