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/14 01:02:15 UTC
[03/47] incubator-kylin git commit: fix KYLIN-547
fix KYLIN-547
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/d83913c0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/d83913c0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/d83913c0
Branch: refs/heads/master
Commit: d83913c09c529f72cd9251fcb1fe8f7594c02ad7
Parents: 2d90b17
Author: jiazhong <ji...@ebay.com>
Authored: Wed Mar 4 20:11:55 2015 +0800
Committer: jiazhong <ji...@ebay.com>
Committed: Wed Mar 4 20:11:55 2015 +0800
----------------------------------------------------------------------
.../kylin/cube/model/validation/rule/RowKeyAttrRule.java | 4 ++--
.../org/apache/kylin/rest/controller/CubeController.java | 8 ++++----
webapp/app/js/controllers/cubeAdvanceSetting.js | 8 ++++++++
webapp/app/partials/cubeDesigner/advanced_settings.html | 4 +++-
webapp/app/partials/cubeDesigner/incremental.html | 2 +-
5 files changed, 18 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d83913c0/cube/src/main/java/org/apache/kylin/cube/model/validation/rule/RowKeyAttrRule.java
----------------------------------------------------------------------
diff --git a/cube/src/main/java/org/apache/kylin/cube/model/validation/rule/RowKeyAttrRule.java b/cube/src/main/java/org/apache/kylin/cube/model/validation/rule/RowKeyAttrRule.java
index 7d769a8..5cd0343 100644
--- a/cube/src/main/java/org/apache/kylin/cube/model/validation/rule/RowKeyAttrRule.java
+++ b/cube/src/main/java/org/apache/kylin/cube/model/validation/rule/RowKeyAttrRule.java
@@ -62,10 +62,10 @@ public class RowKeyAttrRule implements IValidatorRule<CubeDesc> {
for (int i = 0; i < rcd.length; i++) {
RowKeyColDesc rd = rcd[i];
- if (rd.getLength() != 0 && !StringUtils.isEmpty(rd.getDictionary())) {
+ if (rd.getLength() != 0 && (!StringUtils.isEmpty(rd.getDictionary())&&!rd.getDictionary().equals("false"))) {
context.addResult(ResultLevel.ERROR, "Rowkey column " + rd.getColumn() + " must not have both 'length' and 'dictionary' attribute");
}
- if (rd.getLength() == 0 && StringUtils.isEmpty(rd.getDictionary())) {
+ if (rd.getLength() == 0 && (StringUtils.isEmpty(rd.getDictionary())||rd.getDictionary().equals("false"))) {
context.addResult(ResultLevel.ERROR, "Rowkey column " + rd.getColumn() + " must not have both 'length' and 'dictionary' empty");
}
}
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d83913c0/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java
index be91436..51224b8 100644
--- a/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java
+++ b/server/src/main/java/org/apache/kylin/rest/controller/CubeController.java
@@ -311,7 +311,7 @@ public class CubeController extends BasicController {
} catch (IOException e) {
// TODO Auto-generated catch block
logger.error("Failed to deal with the request:" + e.getLocalizedMessage(), e);
- throw new InternalErrorException("Failed to deal with the request: " + e.getLocalizedMessage() + e.getMessage());
+ throw new InternalErrorException("Failed to deal with the request: " + e.getLocalizedMessage());
}
CubeDesc desc = deserializeCubeDesc(cubeRequest);
@@ -372,7 +372,7 @@ public class CubeController extends BasicController {
} catch (IOException e) {
// TODO Auto-generated catch block
logger.error("Failed to deal with the request:" + e.getLocalizedMessage(), e);
- throw new InternalErrorException("Failed to deal with the request: " + e.getLocalizedMessage() + e.getMessage());
+ throw new InternalErrorException("Failed to deal with the request: " + e.getLocalizedMessage());
}
//update cube
@@ -398,7 +398,7 @@ public class CubeController extends BasicController {
throw new ForbiddenException("You don't have right to update this cube.");
} catch (Exception e) {
logger.error("Failed to deal with the request:" + e.getLocalizedMessage(), e);
- throw new InternalErrorException("Failed to deal with the request: " + e.getLocalizedMessage() + e.getMessage());
+ throw new InternalErrorException("Failed to deal with the request: " + e.getLocalizedMessage());
}
if (desc.getError().isEmpty()) {
@@ -476,7 +476,7 @@ public class CubeController extends BasicController {
private DataModelDesc deserializeDataModelDesc(CubeRequest cubeRequest) {
DataModelDesc desc = null;
try {
- logger.debug("Saving cube " + cubeRequest.getModelDescData());
+ logger.debug("Saving MODEL " + cubeRequest.getModelDescData());
desc = JsonUtil.readValue(cubeRequest.getModelDescData(), DataModelDesc.class);
} catch (JsonParseException e) {
logger.error("The data model definition is not valid.", e);
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d83913c0/webapp/app/js/controllers/cubeAdvanceSetting.js
----------------------------------------------------------------------
diff --git a/webapp/app/js/controllers/cubeAdvanceSetting.js b/webapp/app/js/controllers/cubeAdvanceSetting.js
index 782e8ba..4c30905 100644
--- a/webapp/app/js/controllers/cubeAdvanceSetting.js
+++ b/webapp/app/js/controllers/cubeAdvanceSetting.js
@@ -30,4 +30,12 @@ KylinApp.controller('CubeAdvanceSettingCtrl', function ($scope, $modal,cubeConfi
if($scope.state.mode==="edit") {
$scope.metaModel = MetaModel;
}
+
+
+ $scope.dictionaryUpdated = function(rowkey_column){
+ if(rowkey_column.dictionary==="true"){
+ rowkey_column.length=0;
+ }
+
+ }
});
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d83913c0/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 b0d4f4f..e9b533a 100755
--- a/webapp/app/partials/cubeDesigner/advanced_settings.html
+++ b/webapp/app/partials/cubeDesigner/advanced_settings.html
@@ -131,6 +131,7 @@
<div>
<select ng-if="state.mode=='edit'" style="width:80px;"
chosen ng-model="rowkey_column.dictionary"
+ ng-change="dictionaryUpdated(rowkey_column);"
ng-options="dt as dt for dt in cubeConfig.dictionaries">
<option value=""></option>
</select>
@@ -142,7 +143,8 @@
<!--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">
+ ng-disabled="rowkey_column.dictionary=='true'"
+ ng-model="rowkey_column.length" class="form-control">
<span ng-if="state.mode=='view'">{{rowkey_column.length}}</span>
</td>
http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/d83913c0/webapp/app/partials/cubeDesigner/incremental.html
----------------------------------------------------------------------
diff --git a/webapp/app/partials/cubeDesigner/incremental.html b/webapp/app/partials/cubeDesigner/incremental.html
index 6ee70b7..b3bf34e 100755
--- a/webapp/app/partials/cubeDesigner/incremental.html
+++ b/webapp/app/partials/cubeDesigner/incremental.html
@@ -88,4 +88,4 @@
</div>
</div>
</div>
-</div>
\ No newline at end of file
+</div>