You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ma...@apache.org on 2016/11/03 10:39:16 UTC
[4/8] kylin git commit: minor, clearer log on 'Value not exist!' error
minor, clearer log on 'Value not exist!' error
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ca2e0717
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ca2e0717
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ca2e0717
Branch: refs/heads/yang21-hbase1.x
Commit: ca2e071706464e76e503ebdb072b53466121ee71
Parents: 375d4f7
Author: Li Yang <li...@apache.org>
Authored: Thu Nov 3 18:21:55 2016 +0800
Committer: Li Yang <li...@apache.org>
Committed: Thu Nov 3 18:21:55 2016 +0800
----------------------------------------------------------------------
.../main/java/org/apache/kylin/common/util/Dictionary.java | 2 +-
.../java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/ca2e0717/core-common/src/main/java/org/apache/kylin/common/util/Dictionary.java
----------------------------------------------------------------------
diff --git a/core-common/src/main/java/org/apache/kylin/common/util/Dictionary.java b/core-common/src/main/java/org/apache/kylin/common/util/Dictionary.java
index 86ad5ff..0fb299c 100644
--- a/core-common/src/main/java/org/apache/kylin/common/util/Dictionary.java
+++ b/core-common/src/main/java/org/apache/kylin/common/util/Dictionary.java
@@ -159,7 +159,7 @@ abstract public class Dictionary<T> implements Serializable {
else {
int id = getIdFromValueBytesImpl(value, offset, len, roundingFlag);
if (id < 0)
- throw new IllegalArgumentException("Value not exists!");
+ throw new IllegalArgumentException("Value '" + Bytes.toString(value, offset, len) + "' (" + Bytes.toStringBinary(value, offset, len) + ") not exists!");
return id;
}
}
http://git-wip-us.apache.org/repos/asf/kylin/blob/ca2e0717/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java b/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
index f95cc21..aeeb893 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/gridtable/CubeCodeSystem.java
@@ -118,7 +118,13 @@ public class CubeCodeSystem implements IGTCodeSystem {
if (dictEnc.getRoundingFlag() != roundingFlag) {
serializer = dictEnc.copy(roundingFlag).asDataTypeSerializer();
}
- serializer.serialize(value, buf);
+ try {
+ serializer.serialize(value, buf);
+ } catch (IllegalArgumentException ex) {
+ IllegalArgumentException rewordEx = new IllegalArgumentException("Column " + col + " value '" + value + "' met dictionary error: " + ex.getMessage());
+ rewordEx.setStackTrace(ex.getStackTrace());
+ throw rewordEx;
+ }
} else {
if (value instanceof String) {
// for dimensions; measures are converted by MeasureIngestor before reaching this point