You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2015/03/03 11:28:52 UTC

[38/50] incubator-kylin git commit: filter partiton column use only date type column

filter partiton column use only date type column


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

Branch: refs/heads/master
Commit: 8735d15e76352f94078244b5d5e909ab697f2841
Parents: 0a5830e
Author: jiazhong <ji...@ebay.com>
Authored: Fri Feb 27 18:28:06 2015 +0800
Committer: jiazhong <ji...@ebay.com>
Committed: Fri Feb 27 18:28:06 2015 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeEdit.js           | 11 +++++--
 webapp/app/js/controllers/cubes.js              |  4 +--
 .../cubeDesigner/advanced_settings.html         | 34 +++++++++++---------
 .../app/partials/cubeDesigner/incremental.html  |  2 +-
 4 files changed, 31 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8735d15e/webapp/app/js/controllers/cubeEdit.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js
index b632af1..21a666e 100755
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -26,16 +26,23 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams, $locatio
     $scope.cubeMode = absUrl.indexOf("/cubes/add")!=-1?'addNewCube':absUrl.indexOf("/cubes/edit")!=-1?'editExistCube':'default';
 
 
-    $scope.getColumnsByTable = function (name) {
+    $scope.getColumnsByTable = function (tableName) {
         var temp = [];
         angular.forEach(TableModel.selectProjectTables, function (table) {
-            if (table.name == name) {
+            if (table.name == tableName) {
                 temp = table.columns;
             }
         });
         return temp;
     };
 
+    $scope.getPartitonColumns = function(tableName){
+        var columns = _.filter($scope.getColumnsByTable(tableName),function(column){
+            return column.datatype==="date";
+        });
+        return columns;
+    };
+
     $scope.getColumnType = function (_column,table){
         var columns = $scope.getColumnsByTable(table);
         var type;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8735d15e/webapp/app/js/controllers/cubes.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubes.js b/webapp/app/js/controllers/cubes.js
index 927fda1..35266a4 100755
--- a/webapp/app/js/controllers/cubes.js
+++ b/webapp/app/js/controllers/cubes.js
@@ -360,9 +360,9 @@ KylinApp
         }
     });
 
-var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, cube,metaModel, buildType,SweetAlert,loadingRequest) {
+var jobSubmitCtrl = function ($scope, $modalInstance, CubeService, MessageService, $location, cube,MetaModel, buildType,SweetAlert,loadingRequest) {
     $scope.cube = cube;
-    $scope.metaModel = metaModel;
+    $scope.metaModel = MetaModel;
     $scope.jobBuildRequest = {
         buildType: buildType,
         startTime: 0,

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8735d15e/webapp/app/partials/cubeDesigner/advanced_settings.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/advanced_settings.html b/webapp/app/partials/cubeDesigner/advanced_settings.html
old mode 100644
new mode 100755
index 5c65886..b0d4f4f
--- a/webapp/app/partials/cubeDesigner/advanced_settings.html
+++ b/webapp/app/partials/cubeDesigner/advanced_settings.html
@@ -95,9 +95,9 @@
             <tr>
                 <th>ID</th>
                 <th>Column</th>
-                <th>Length</th>
-                <th>Dictionary</th>
                 <th>Mandatory</th>
+                <th>Dictionary</th>
+                <th>Length</th>
                 <th ng-if="state.mode=='edit'"></th>
             </tr>
 
@@ -115,13 +115,17 @@
                     <span ng-if="state.mode=='view'">{{rowkey_column.column}}</span>
                 </td>
                 <td>
-                    <!--Column Length -->
-                    <input type="text" class="form-control" placeholder="Column Length.." ng-if="state.mode=='edit'"
-                           tooltip="rowkey column length.." tooltip-trigger="focus"
-                           ng-model="rowkey_column.length" class="form-control">
+                    <!-- Mandatory -->
+                    <button type="button " ng-if="state.mode=='edit'"
+                            class="btn btn-xs btn-default {{rowkey_column.mandatory? 'active':''}}"
+                            ng-model="rowkey_column.mandatory"
+                            btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false">
+                        {{rowkey_column.mandatory? 'Y':'N'}}
+                    </button>
 
-                    <span ng-if="state.mode=='view'">{{rowkey_column.length}}</span>
+                    <span ng-if="state.mode=='view'">{{rowkey_column.mandatory? 'Y':'N'}}</span>
                 </td>
+
                 <td>
                     <!--Use Dictionary-->
                     <div>
@@ -133,17 +137,17 @@
                         <span ng-if="state.mode=='view'">{{rowkey_column.dictionary}}</span>
                     </div>
                 </td>
+
                 <td>
-                    <!-- Mandatory -->
-                    <button type="button " ng-if="state.mode=='edit'"
-                            class="btn btn-xs btn-default {{rowkey_column.mandatory? 'active':''}}"
-                            ng-model="rowkey_column.mandatory"
-                            btn-checkbox btn-checkbox-true="true" btn-checkbox-false="false">
-                        {{rowkey_column.mandatory? 'Y':'N'}}
-                    </button>
+                    <!--Column Length -->
+                    <input type="text" class="form-control" placeholder="Column Length.." ng-if="state.mode=='edit'"
+                           tooltip="rowkey column length.." tooltip-trigger="focus"
+                           ng-model="rowkey_column.length" class="form-control">
 
-                    <span ng-if="state.mode=='view'">{{rowkey_column.mandatory? 'Y':'N'}}</span>
+                    <span ng-if="state.mode=='view'">{{rowkey_column.length}}</span>
                 </td>
+
+
                 <td ng-if="state.mode=='edit'">
                     <button class="btn btn-xs btn-info"
                             ng-click="removeElement(cubeMetaFrame.rowkey.rowkey_columns, rowkey_column)"><i

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/8735d15e/webapp/app/partials/cubeDesigner/incremental.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/incremental.html b/webapp/app/partials/cubeDesigner/incremental.html
index 496cc36..365ef43 100755
--- a/webapp/app/partials/cubeDesigner/incremental.html
+++ b/webapp/app/partials/cubeDesigner/incremental.html
@@ -46,7 +46,7 @@
                             ng-required="metaModel.model.partition_desc.partition_date_start"
                             ng-model="metaModel.model.partition_desc.partition_date_column"
                             ng-if="state.mode=='edit'"
-                            ng-options="metaModel.model.fact_table+'.'+columns.name as metaModel.model.fact_table+'.'+columns.name for columns in getColumnsByTable(metaModel.model.fact_table)" >
+                            ng-options="metaModel.model.fact_table+'.'+columns.name as metaModel.model.fact_table+'.'+columns.name for columns in getPartitonColumns(metaModel.model.fact_table)" >
                         <option value=""></option>
                     </select>
                     <span ng-if="state.mode=='view'">