You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by zh...@apache.org on 2016/10/20 10:13:26 UTC
kylin git commit: KYLIN-2111 only allow columns from Model dimensions
when add group by column to TOP_N
Repository: kylin
Updated Branches:
refs/heads/master 0060304e3 -> 5e26fd5cc
KYLIN-2111 only allow columns from Model dimensions when add group by column to TOP_N
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5e26fd5c
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5e26fd5c
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5e26fd5c
Branch: refs/heads/master
Commit: 5e26fd5ccc13d6eb2c6d1505cf8b7763cdf1b663
Parents: 0060304
Author: Jason <ji...@163.com>
Authored: Thu Oct 20 18:12:42 2016 +0800
Committer: Jason <ji...@163.com>
Committed: Thu Oct 20 18:13:15 2016 +0800
----------------------------------------------------------------------
webapp/app/js/controllers/cubeEdit.js | 30 +++++++--------------
webapp/app/partials/cubeDesigner/measures.html | 2 +-
2 files changed, 10 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/5e26fd5c/webapp/app/js/controllers/cubeEdit.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js
index e9bd93e..5f46799 100755
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -137,31 +137,19 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio
return me_columns;
};
- $scope.getGroupBYColumns = function () {
- //metric from model
- var me_columns = [];
- var table_columns=[];
- var groupby_columns=[];
- var tableColumns = $scope.getColumnsByTable($scope.metaModel.model.fact_table);
- if($scope.metaModel.model.metrics){
- angular.forEach($scope.metaModel.model.metrics,function(metric,index){
- me_columns.push(metric);
- });
- }
- angular.forEach($scope.cubeMetaFrame.dimensions,function(dimension){
- if(dimension.table==$scope.metaModel.model.fact_table) {
- table_columns.push(dimension.column);
- }
- });
- angular.forEach(me_columns,function(column){
- if(table_columns.indexOf(column)==-1) {
- groupby_columns.push(column);
+ $scope.getGroupByColumns = function () {
+ var groupBy_columns=[];
+
+ angular.forEach($scope.metaModel.model.dimensions,function(dimension,index){
+ if(dimension.columns){
+ groupBy_columns = groupBy_columns.concat(dimension.columns);
}
- });
+ })
- return groupby_columns;
+ return groupBy_columns;
};
+
$scope.getExtendedHostColumn = function(){
var me_columns = [];
//add cube dimension column for specific measure
http://git-wip-us.apache.org/repos/asf/kylin/blob/5e26fd5c/webapp/app/partials/cubeDesigner/measures.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/measures.html b/webapp/app/partials/cubeDesigner/measures.html
index 925cc79..b4513f2 100755
--- a/webapp/app/partials/cubeDesigner/measures.html
+++ b/webapp/app/partials/cubeDesigner/measures.html
@@ -251,7 +251,7 @@
<td>
<select class="form-control" chosen ng-if="nextPara.type !== 'constant'" required
ng-model="groupby_column.name"
- ng-options="column as column for column in getGroupBYColumns()" style="width:200px;">
+ ng-options="column as column for column in getGroupByColumns()" style="width:200px;">
<option value="">--Select A Column--</option>
</select>
</td>