Repository: kylin Updated Branches: refs/heads/master f12a5e77e -> 413bc9f2d
KYLIN-1698-BIGINT Signed-off-by: Jason <jiat...@163.com> Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/e3a1767f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/e3a1767f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/e3a1767f Branch: refs/heads/master Commit: e3a1767f07dcb7365480d0fa495083d8bfdd0344 Parents: f12a5e7 Author: chenzhx <346839...@qq.com> Authored: Tue Sep 6 17:20:15 2016 +0800 Committer: Jason <jiat...@163.com> Committed: Wed Sep 7 15:48:50 2016 +0800 ---------------------------------------------------------------------- webapp/app/js/controllers/modelEdit.js | 25 +++++++++++++++++++- .../modelDesigner/conditions_settings.html | 10 ++++---- 2 files changed, 29 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/e3a1767f/webapp/app/js/controllers/modelEdit.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/controllers/modelEdit.js b/webapp/app/js/controllers/modelEdit.js index a916aad..2532fb4 100644 --- a/webapp/app/js/controllers/modelEdit.js +++ b/webapp/app/js/controllers/modelEdit.js @@ -35,7 +35,7 @@ KylinApp.controller('ModelEditCtrl', function ($scope, $q, $routeParams, $locati $scope.getPartitonColumns = function(tableName){ var columns = _.filter($scope.getColumnsByTable(tableName),function(column){ - return column.datatype==="date"||column.datatype==="timestamp"||column.datatype==="string"||column.datatype.startsWith("varchar"); + return column.datatype==="date"||column.datatype==="timestamp"||column.datatype==="string"||column.datatype.startsWith("varchar")||column.datatype==="bigint"; }); return columns; }; @@ -69,6 +69,26 @@ KylinApp.controller('ModelEditCtrl', function ($scope, $q, $routeParams, $locati return type; }; + $scope.isBigInt=false; + $scope.partitionChange = function (dateColumn) { + var column = _.filter($scope.getColumnsByTable($scope.modelsManager.selectedModel.fact_table),function(_column){ + var columnName=$scope.modelsManager.selectedModel.fact_table+"."+_column.name; + if(dateColumn==columnName) + return _column; + }); + if(column[0].datatype==="bigint"){ + $scope.isBigInt=true; + $scope.modelsManager.selectedModel.partition_desc.partition_date_format=null;; + $scope.partitionColumn.hasSeparateTimeColumn=false; + $scope.modelsManager.selectedModel.partition_desc.partition_time_column=null; + $scope.modelsManager.selectedModel.partition_desc.partition_time_format=null; + } + else{ + $scope.isBigInt=false; + } + + } + // ~ Define data $scope.state = { "modelSchema": "", @@ -87,6 +107,9 @@ KylinApp.controller('ModelEditCtrl', function ($scope, $q, $routeParams, $locati ModelDescService.query({model_name: modelName}, function (model) { if (model) { modelsManager.selectedModel = model; + if(!$scope.modelsManager.selectedModel.partition_desc.partition_data_format){ + $scope.isBigInt = true; + } if($scope.modelsManager.selectedModel.partition_desc.partition_time_column){ $scope.partitionColumn.hasSeparateTimeColumn = true; } http://git-wip-us.apache.org/repos/asf/kylin/blob/e3a1767f/webapp/app/partials/modelDesigner/conditions_settings.html ---------------------------------------------------------------------- diff --git a/webapp/app/partials/modelDesigner/conditions_settings.html b/webapp/app/partials/modelDesigner/conditions_settings.html index a4e49a9..693241c 100644 --- a/webapp/app/partials/modelDesigner/conditions_settings.html +++ b/webapp/app/partials/modelDesigner/conditions_settings.html @@ -46,7 +46,7 @@ <select style="width: 100%" chosen data-placeholder="e.g. DEFAULT.TEST_KYLIN_FACT.CAL_DT" ng-model="modelsManager.selectedModel.partition_desc.partition_date_column" - ng-if="state.mode=='edit'" + ng-if="state.mode=='edit'" ng-change="partitionChange(modelsManager.selectedModel.partition_desc.partition_date_column)" data-placement="" ng-options="modelsManager.selectedModel.fact_table+'.'+columns.name as modelsManager.selectedModel.fact_table+'.'+columns.name for columns in getPartitonColumns(modelsManager.selectedModel.fact_table)" > <option value="">--Select Partition Column--</option> @@ -60,14 +60,14 @@ </div> <!--Date Format--> - <div class="form-group"> + <div class="form-group" ng-if="isBigInt==false"> <div class="row"> <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Date Format</b></label> <div class="col-xs-12 col-sm-6"> <select style="width: 100%" chosen ng-required="modelsManager.selectedModel.partition_desc.partition_date_format" ng-model="modelsManager.selectedModel.partition_desc.partition_date_format" - ng-if="state.mode=='edit'" + ng-if="state.mode=='edit'" ng-disable="isBigInt(modelsManager.selectedModel.partition_desc.partition_date_column)" data-placement="" ng-options="ddt as ddt for ddt in cubeConfig.partitionDateFormatOpt"> <option value="">--Select Date Format--</option> @@ -78,7 +78,7 @@ </div> <!--Date Format--> - <div class="form-group middle-popover"> + <div class="form-group middle-popover" ng-if="isBigInt==false"> <div class="row"> <label class="control-label col-xs-12 col-sm-3 no-padding-right font-color-default"><b>Has a separate "time of the day" column ?</b> <i kylinpopover placement="right" title="Separate Time Column" template="separateTimeColumnTip.html" class="fa fa-info-circle"></i></label> <div class="col-xs-12 col-sm-6"> @@ -164,7 +164,7 @@ <script type="text/ng-template" id="partitionTip.html"> <ol> <li>Partition date column not required,leave as default if cube always need full build</Li> - <li>Column should contain date value (type can be Date, Timestamp, String, VARCHAR, etc.)</li> + <li>Column should contain date value (type can be Date, Timestamp, String, VARCHAR,BigInt, etc.)</li> </ol> </script>