kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [38/41] incubator-kylin git commit: KYLIN-683
Date Sun, 26 Apr 2015 04:22:45 GMT
KYLIN-683


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

Branch: refs/heads/streaming
Commit: 2674bf6650d31f1f2b1f2831886fc3168b64dc9d
Parents: 214ec88
Author: jiazhong <jiazhong@ebay.com>
Authored: Tue Apr 14 14:25:08 2015 +0800
Committer: jiazhong <jiazhong@ebay.com>
Committed: Tue Apr 14 14:25:08 2015 +0800

----------------------------------------------------------------------
 .../apache/kylin/rest/model/Performance.java    |  7 ++++++
 .../kylin/rest/service/PerformanceService.java  |  7 ++++++
 .../kylin/rest/util/PerformanceMonitorTask.java |  7 ++++++
 webapp/app/js/controllers/cubeSchema.js         | 24 ++++++++++++++++++--
 webapp/app/partials/cubeDesigner/measures.html  |  1 +
 5 files changed, 44 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/2674bf66/server/src/main/java/org/apache/kylin/rest/model/Performance.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/model/Performance.java b/server/src/main/java/org/apache/kylin/rest/model/Performance.java
new file mode 100644
index 0000000..33071b2
--- /dev/null
+++ b/server/src/main/java/org/apache/kylin/rest/model/Performance.java
@@ -0,0 +1,7 @@
+package org.apache.kylin.rest.model;
+
+/**
+ * Created by jiazhong on 2015/4/13.
+ */
+public class Performance {
+}

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/2674bf66/server/src/main/java/org/apache/kylin/rest/service/PerformanceService.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/service/PerformanceService.java b/server/src/main/java/org/apache/kylin/rest/service/PerformanceService.java
new file mode 100644
index 0000000..cfae02a
--- /dev/null
+++ b/server/src/main/java/org/apache/kylin/rest/service/PerformanceService.java
@@ -0,0 +1,7 @@
+package org.apache.kylin.rest.service;
+
+/**
+ * Created by jiazhong on 2015/4/13.
+ */
+public class PerformanceService {
+}

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/2674bf66/server/src/main/java/org/apache/kylin/rest/util/PerformanceMonitorTask.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/util/PerformanceMonitorTask.java b/server/src/main/java/org/apache/kylin/rest/util/PerformanceMonitorTask.java
new file mode 100644
index 0000000..1f777b0
--- /dev/null
+++ b/server/src/main/java/org/apache/kylin/rest/util/PerformanceMonitorTask.java
@@ -0,0 +1,7 @@
+package org.apache.kylin.rest.util;
+
+/**
+ * Created by jiazhong on 2015/4/13.
+ */
+public class PerformanceMonitorTask {
+}

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/2674bf66/webapp/app/js/controllers/cubeSchema.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeSchema.js b/webapp/app/js/controllers/cubeSchema.js
index 89ee492..cc8390d 100755
--- a/webapp/app/js/controllers/cubeSchema.js
+++ b/webapp/app/js/controllers/cubeSchema.js
@@ -75,18 +75,38 @@ KylinApp.controller('CubeSchemaCtrl', function ($scope, QueryService,
UserServic
 
     //map right return type for param
     $scope.measureReturnTypeUpdate = function(){
-        if($scope.newMeasure.function.expression!=="COUNT_DISTINCT"){
+        if($scope.newMeasure.function.parameter.type=="constant"&&$scope.newMeasure.function.expression!=="COUNT_DISTINCT"){
+            switch($scope.newMeasure.function.expression){
+                case "SUM":
+                case "COUNT":
+                    $scope.newMeasure.function.returntype = "bigint";
+                    break;
+                default:
+                    $scope.newMeasure.function.returntype = "";
+                    break;
+            }
+        }
+        if($scope.newMeasure.function.parameter.type=="column"&&$scope.newMeasure.function.expression!=="COUNT_DISTINCT"){
 
             var column = $scope.newMeasure.function.parameter.value;
             var colType = $scope.getColumnType(column, $scope.metaModel.model.fact_table);
// $scope.getColumnType defined in cubeEdit.js
 
+            if(colType==""||!colType){
+                $scope.newMeasure.function.returntype = "";
+                return;
+            }
+
 
             switch($scope.newMeasure.function.expression){
                 case "SUM":
                     if(colType==="smallint"||colType==="int"||colType==="bigint"){
                         $scope.newMeasure.function.returntype= 'bigint';
                     }else{
-                        $scope.newMeasure.function.returntype= 'decimal';
+                        if(colType.indexOf('decimal')!=-1){
+                            $scope.newMeasure.function.returntype= colType;
+                        }else{
+                            $scope.newMeasure.function.returntype= 'decimal';
+                        }
                     }
                     break;
                 case "MIN":

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/2674bf66/webapp/app/partials/cubeDesigner/measures.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/measures.html b/webapp/app/partials/cubeDesigner/measures.html
index c45ae8e..47e2d1f 100755
--- a/webapp/app/partials/cubeDesigner/measures.html
+++ b/webapp/app/partials/cubeDesigner/measures.html
@@ -128,6 +128,7 @@
                                 <select class="form-control" ng-if="newMeasure.function.expression
!= 'COUNT'"
                                     ng-init="newMeasure.function.parameter.type=(!!newMeasure.function.parameter.type)?newMeasure.function.parameter.type:
'column' "
                                     chosen ng-model="newMeasure.function.parameter.type"
required
+                                    ng-change="measureReturnTypeUpdate();"
                                     ng-options="mpt as mpt for mpt in cubeConfig.measureParamType">
                                     <option value=""></option>
                                 </select>


Mime
View raw message