You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2016/07/25 12:12:58 UTC

[26/50] [abbrv] kylin git commit: KYLIN-1766 date/time encoding UI update & add tip for int encoding

KYLIN-1766 date/time encoding UI update & add tip for int encoding

Signed-off-by: Jason <ji...@163.com>


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

Branch: refs/heads/1.5.x-HBase1.x
Commit: 2224eec343790c0676b4d92e2de6ce58bc2abf8b
Parents: 8735c28
Author: Jason <ji...@163.com>
Authored: Sun Jul 10 20:31:11 2016 +0800
Committer: Jason <ji...@163.com>
Committed: Sun Jul 10 20:36:01 2016 +0800

----------------------------------------------------------------------
 webapp/app/js/controllers/cubeAdvanceSetting.js         | 10 +++++++---
 webapp/app/js/controllers/cubeSchema.js                 |  3 +++
 webapp/app/partials/cubeDesigner/advanced_settings.html |  2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/2224eec3/webapp/app/js/controllers/cubeAdvanceSetting.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeAdvanceSetting.js b/webapp/app/js/controllers/cubeAdvanceSetting.js
index c3110b5..09fb3d4 100644
--- a/webapp/app/js/controllers/cubeAdvanceSetting.js
+++ b/webapp/app/js/controllers/cubeAdvanceSetting.js
@@ -28,7 +28,7 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function ($scope, $modal,cubeConfi
     //var _isDictionary = item.encoding === "dict"?"true":"false";
     var _isFixedLength = item.encoding.substring(0,12) === "fixed_length"?"true":"false";//fixed_length:12
     var _isIntLength = item.encoding.substring(0,3) === "int"?"true":"false";//fixed_length:12
-    var _encoding = "dict";
+    var _encoding = item.encoding;
     var _valueLength ;
     if(_isFixedLength !=="false"){
       _valueLength = item.encoding.substring(13,item.encoding.length);
@@ -38,6 +38,7 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function ($scope, $modal,cubeConfi
       _valueLength = item.encoding.substring(4,item.encoding.length);
       _encoding = "int";
     }
+
     var rowkeyObj = {
       column:item.column,
       encoding:_encoding,
@@ -56,17 +57,20 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function ($scope, $modal,cubeConfi
   }
 
   $scope.refreshRowKey = function(list,index,item,checkShard){
-    var encoding = "dict";
+    var encoding;
     var column = item.column;
     var isShardBy = item.isShardBy;
-    if(item.encoding!=="dict"){
+    if(item.encoding!=="dict" && item.encoding!=="date"&& item.encoding!=="time"){
       if(item.encoding=="fixed_length" && item.valueLength){
         encoding = "fixed_length:"+item.valueLength;
       }
       else if(item.encoding=="int" && item.valueLength){
         encoding = "int:"+item.valueLength;
+      }else{
+        encoding = item.encoding;
       }
     }else{
+      encoding = item.encoding;
       item.valueLength=0;
     }
     $scope.cubeMetaFrame.rowkey.rowkey_columns[index].column = column;

http://git-wip-us.apache.org/repos/asf/kylin/blob/2224eec3/webapp/app/js/controllers/cubeSchema.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeSchema.js b/webapp/app/js/controllers/cubeSchema.js
index 2aafd33..d7dfc09 100755
--- a/webapp/app/js/controllers/cubeSchema.js
+++ b/webapp/app/js/controllers/cubeSchema.js
@@ -267,6 +267,9 @@ KylinApp.controller('CubeSchemaCtrl', function ($scope, QueryService, UserServic
           if(rowkey.isShardBy == true){
             shardRowkeyList.push(rowkey.column);
           }
+          if(rowkey.encoding.substr(0,3)=='int' && (rowkey.encoding.substr(4)<1 || rowkey.encoding.substr(4)>8)){
+            errors.push("int encoding column length should between 1 and 8.");
+          }
         })
         if(shardRowkeyList.length >1){
           errors.push("At most one 'shard by' column is allowed.");

http://git-wip-us.apache.org/repos/asf/kylin/blob/2224eec3/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
index 5f18b51..62e1dd5 100755
--- a/webapp/app/partials/cubeDesigner/advanced_settings.html
+++ b/webapp/app/partials/cubeDesigner/advanced_settings.html
@@ -261,7 +261,7 @@
                       <!--Column Length -->
                       <input type="text" class="form-control" placeholder="Column Length.." ng-if="state.mode=='edit'"
                              tooltip="rowkey column length.." tooltip-trigger="focus"
-                             ng-disabled="rowkey_column.encoding=='dict'"
+                             ng-disabled="rowkey_column.encoding=='dict'||rowkey_column.encoding=='date'||rowkey_column.encoding=='time'"
                              ng-change="refreshRowKey(convertedRowkeys,$index,rowkey_column);"
                              ng-model="rowkey_column.valueLength" class="form-control">