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 2016/11/06 09:31:15 UTC
[39/49] 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/235b123d
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/235b123d
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/235b123d
Branch: refs/heads/KYLIN-1971
Commit: 235b123d09c629b685cbaf029f205bbeab887d6f
Parents: 1395955
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:23:01 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/235b123d/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/235b123d/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