kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhongj...@apache.org
Subject kylin git commit: KYLIN-811 streaming parser setting update
Date Mon, 04 Jan 2016 16:51:05 GMT
Repository: kylin
Updated Branches:
  refs/heads/2.x-staging 2ac2f56a1 -> 5d1734b5e


KYLIN-811 streaming parser setting update


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

Branch: refs/heads/2.x-staging
Commit: 5d1734b5e573bd7f20f6b2609d8ee2b6dcd6ce32
Parents: 2ac2f56
Author: jian <jiazhong@apache.org>
Authored: Tue Jan 5 00:50:08 2016 +0800
Committer: jian <jiazhong@apache.org>
Committed: Tue Jan 5 00:50:45 2016 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeEdit.js           | 21 +++++++++++++++----
 webapp/app/js/controllers/sourceMeta.js         | 22 ++++++++++----------
 webapp/app/js/model/cubeConfig.js               |  2 +-
 webapp/app/less/app.less                        |  3 +++
 .../partials/cubeDesigner/streamingConfig.html  | 16 ++++++++++++++
 webapp/app/partials/tables/table_load.html      | 10 ++++-----
 6 files changed, 53 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/5d1734b5/webapp/app/js/controllers/cubeEdit.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeEdit.js b/webapp/app/js/controllers/cubeEdit.js
index f397d49..a2464b4 100755
--- a/webapp/app/js/controllers/cubeEdit.js
+++ b/webapp/app/js/controllers/cubeEdit.js
@@ -709,6 +709,10 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
   });
 
 
+  $scope.streamingCfg = {
+    parseTsColumn:"{{}}",
+    columnOptions:[]
+  }
   //dimensions options is depend on the model input when add cube
   $scope.$watch('cubeMetaFrame.model_name', function (newValue, oldValue) {
     if (!newValue) {
@@ -719,18 +723,27 @@ KylinApp.controller('CubeEditCtrl', function ($scope, $q, $routeParams,
$locatio
     if(!$scope.metaModel.model){
       return;
     }
+
     var factTable = $scope.metaModel.model.fact_table;
     var cols = $scope.getColumnsByTable(factTable);
-    //
+
     for(var i=0;i<cols.length;i++){
       var col = cols[i];
-      if(col.datatype === "timestamp"&&col.name.indexOf("_TS")==-1){
-        $scope.kafkaMeta.parserProperties = "tsColName="+col.name+";formatTs=TRUE";
-        break;
+      if(col.datatype === "timestamp"){
+        $scope.streamingCfg.columnOptions.push(col.name);
       }
     }
+    $scope.kafkaMeta.parserProperties = "tsColName=' ';formatTs=TRUE";
+
 
   });
+
+  $scope.streamingTsColUpdate = function(){
+    if(!$scope.streamingCfg.parseTsColumn){
+      $scope.streamingCfg.parseTsColumn = ' ';
+    }
+    $scope.kafkaMeta.parserProperties = "tsColName="+$scope.streamingCfg.parseTsColumn+";formatTs=TRUE";
+  }
   $scope.$on('DimensionsEdited', function (event) {
     if ($scope.cubeMetaFrame) {
       reGenerateRowKey();

http://git-wip-us.apache.org/repos/asf/kylin/blob/5d1734b5/webapp/app/js/controllers/sourceMeta.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/sourceMeta.js b/webapp/app/js/controllers/sourceMeta.js
index 1bbe9c8..e29bcb5 100755
--- a/webapp/app/js/controllers/sourceMeta.js
+++ b/webapp/app/js/controllers/sourceMeta.js
@@ -287,17 +287,17 @@ KylinApp
           return;
         }
 
-        var timestampCount = 0;
-        angular.forEach($scope.columnList,function(item){
-          if(item.checked == "Y"&&item.type=="timestamp"&&item.fromSource=='Y'){
-            timestampCount++;
-          }
-        })
-
-        if(timestampCount!=1){
-          $scope.rule.timestampColumnConflict = true;
-          return;
-        }
+        //var timestampCount = 0;
+        //angular.forEach($scope.columnList,function(item){
+        //  if(item.checked == "Y"&&item.type=="timestamp"&&item.fromSource=='Y'){
+        //    timestampCount++;
+        //  }
+        //})
+
+        //if(timestampCount!=1){
+        //  $scope.rule.timestampColumnConflict = true;
+        //  return;
+        //}
 
         var columns = [];
         angular.forEach($scope.columnList,function(column,$index){

http://git-wip-us.apache.org/repos/asf/kylin/blob/5d1734b5/webapp/app/js/model/cubeConfig.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/model/cubeConfig.js b/webapp/app/js/model/cubeConfig.js
index cc931d9..20624bd 100644
--- a/webapp/app/js/model/cubeConfig.js
+++ b/webapp/app/js/model/cubeConfig.js
@@ -70,7 +70,7 @@ KylinApp.constant('cubeConfig', {
     {attr: 'owner', name: 'Owner'},
     {attr: 'create_time', name: 'Create Time'}
   ],
-  streamingAutoGenerateMeasure:['year_start_ts','month_start_ts','day_start_ts','hour_start_ts','min_start_ts'],
+  streamingAutoGenerateMeasure:['year_start','quarter_start','month_start','week_start','day_start','hour_start','minute_start'],
   partitionDateFormatOpt:[
     'yyyy-MM-dd',
     'yyyyMMdd'

http://git-wip-us.apache.org/repos/asf/kylin/blob/5d1734b5/webapp/app/less/app.less
----------------------------------------------------------------------
diff --git a/webapp/app/less/app.less b/webapp/app/less/app.less
index fc80698..fda5ad3 100644
--- a/webapp/app/less/app.less
+++ b/webapp/app/less/app.less
@@ -666,3 +666,6 @@ ul.messenger .messenger-message-inner,.ngCellText {
   content:"*";
   color:red;
 }
+.streamingParserCtr .chosen-container{
+  width:200px !important;
+}

http://git-wip-us.apache.org/repos/asf/kylin/blob/5d1734b5/webapp/app/partials/cubeDesigner/streamingConfig.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/streamingConfig.html b/webapp/app/partials/cubeDesigner/streamingConfig.html
index 6e88553..ed03229 100644
--- a/webapp/app/partials/cubeDesigner/streamingConfig.html
+++ b/webapp/app/partials/cubeDesigner/streamingConfig.html
@@ -234,7 +234,23 @@
               </div>
             </div>
           </div>
+          <div class="form-group" ng-if="state.mode=='edit'" ng-class="{'required':state.mode=='edit'}">
+            <div class="row">
+              <label class="col-xs-12 col-sm-3 control-label no-padding-right">
+                <b>Parser Timestamp Column</b>
+              </label>
 
+              <div class="col-xs-12 col-sm-6 streamingParserCtr">
+                  <select chosen ng-model="streamingCfg.parseTsColumn"
+                           ng-options="column as column for column in streamingCfg.columnOptions
"
+                           ng-change="streamingTsColUpdate()"
+                           data-placeholder="select a column"
+                           class="chosen-select">
+                    <option value=""></option>
+                  </select>
+              </div>
+            </div>
+          </div>
           <div class="form-group" ng-class="{'required':state.mode=='edit'}">
             <div class="row">
               <label class="col-xs-12 col-sm-3 control-label no-padding-right">

http://git-wip-us.apache.org/repos/asf/kylin/blob/5d1734b5/webapp/app/partials/tables/table_load.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/tables/table_load.html b/webapp/app/partials/tables/table_load.html
index 99c993d..468208b 100644
--- a/webapp/app/partials/tables/table_load.html
+++ b/webapp/app/partials/tables/table_load.html
@@ -66,8 +66,8 @@
       </div>
       <div class="col-xs-6" ng-show="table.sourceValid">
         <ol class="text-info" style="margin-bottom: 30px;">
-          <li>Choose one 'timestamp' type column for streaming table.</li>
-          <li>Uncheck the 'timestamp' type column which will not be used.</li>
+          <li>Choose 'timestamp' type column for streaming table.</li>
+          <li>derived time dimensions are calculated from timestamp field to help analysis
against different time granularities.</li>
         </ol>
         <form class="form-horizontal" name="form.setStreamingSchema" novalidate>
           <div class="form-group required">
@@ -108,8 +108,8 @@
               </select>
             </td>
             <td>
-              <label ng-if="column.type=='timestamp'&&column.fromSource=='Y'"
class="badge badge-info">TIMESTAMP</label>
-              <label ng-if="column.fromSource=='N'" class="badge badge-info">AUTO APPEND</label>
+              <label ng-if="column.type=='timestamp'&&column.fromSource=='Y'"
class="badge badge-info">timestamp</label>
+              <label ng-if="column.fromSource=='N'" class="badge badge-info">derived
time dimension</label>
             </td>
           </tr>
         </table>
@@ -127,4 +127,4 @@
       </button>
       <button class="btn btn-primary" ng-click="cancel()">Cancel</button>
     </div>
-  </script>
\ No newline at end of file
+  </script>


Mime
View raw message